https://wiki.wesnoth.org/Sandbox/GUI/Getting_Started#Building_a_Tree uses <syntaxhighlight lang=lua line>, and clicking it selects
1local function basic_tree_view()
2 local tree_view = wml.tag.tree_view {
3 id = "monsters_tv",
4 ...
Expected behaviour would be excluding line numbers. Proof of concept solution (chrome):
$(".cb-icon").click(function(event) {
var e = $(this).parents(".codebox").children("pre")[0];
let textResult = "";
for (node of e.childNodes){
if(typeof node.getAttribute !== "function" || node.getAttribute("class") !== "linenos"){
let currentText = node.innerText || node.nodeValue;
if (currentText) {
textResult += currentText;
}
}
}
navigator.clipboard.writeText(textResult);
});
https://wiki.wesnoth.org/Sandbox/GUI/Getting_Started#Building_a_Tree uses
<syntaxhighlight lang=lua line>, and clicking it selectsExpected behaviour would be excluding line numbers. Proof of concept solution (chrome):