¿Cómo puede recuperar todos los nodejs dentro del rango seleccionado en javascript, por ejemplo, si resalto los siguientes nodejs en esta publicación de stackoverflow? ¿Es posible crear un iterador simple dado el node base y de extensión que recorre el DOMTree entre los dos?{*** } 
Intenté usar Range y TreeWalker, pero no se me ocurrió nada. Solo obtengo un recuento de rango de 1.
Puede obtener una copia de los nodejs seleccionados recorriendo el rango seleccionado y clonando el contenido de la selección del rango. Recopile todos los nodejs clonados en un objeto DocumentFragment .
Luego cree un TreeWalker con el objeto DocumentFragment que tiene los elementos recopilados y empuje cada node a una nueva matriz.
La matriz resultante será una lista de todos los nodejs de la selección.
Ejecute el ejemplo a continuación y verifique la consola de su navegador después de seleccionar el texto y hacer clic en el botón Obtener nodejs seleccionados .
const button = document.getElementById('get-nodes');
function getSelectedNodes() {
const selection = document.getSelection();
const fragment = document.createDocumentFragment();
const nodeList = [];
for (let i = 0; i < selection.rangeCount; i++) {
fragment.append(selection.getRangeAt(i).cloneContents());
}
const walker = document.createTreeWalker(fragment);
let currentNode = walker.currentNode;
while(currentNode) {
nodeList.push(currentNode);
currentNode = walker.nextNode();
}
return nodeList;
}
button.addEventListener('click', () => {
const nodeList = getSelectedNodes();
console.log(nodeList);
});
<button id="get-nodes">Get selected nodes</button>
<div class="s-prose js-post-body" itemprop="text">
<p>I'm running spring cloud dataflow server in a container and was able to configure app logs to a specific folder that is brought outside of the container. However, I can't figure out how to store dataflow server logs themselves in a file.</p>
<p>According to this:
<a href="https://docs.spring.io/spring-cloud-dataflow/docs/2.7.2/reference/htmlsingle/#configuration-local-logging" rel="nofollow noreferrer">https://docs.spring.io/spring-cloud-dataflow/docs/2.7.2/reference/htmlsingle/#configuration-local-logging</a></p>
<p>It should be plain and simple, just set LOG_PATH and that's pretty much it. But that does nothing. And when I look at logback-spring.xml in the jar file, I can see that:</p>
<pre class="default s-code-block"><code class="hljs language-xml"> <span class="hljs-tag"><<span class="hljs-name">root</span> <span class="hljs-attr">level</span>=<span class="hljs-string">"INFO"</span>></span>
<span class="hljs-tag"><<span class="hljs-name">appender-ref</span> <span class="hljs-attr">ref</span>=<span class="hljs-string">"STDOUT"</span>/></span>
<span class="hljs-tag"></<span class="hljs-name">root</span>></span>
</code></pre>
<p>Which in my understanding is the reason why the logs don't go into the file, they just go to the console.</p>
<p>Is there a way to override the appender-ref attribute in the logback-spring.xml with an environnment variable, or how can I get the dataflow server logs in a file?</p>
</div>