diff --git a/tools/inspector_data/inspector.js b/tools/inspector_data/inspector.js index 3aaa408..b72499a 100644 --- a/tools/inspector_data/inspector.js +++ b/tools/inspector_data/inspector.js @@ -89,12 +89,13 @@ window.onload = function() { element.setAttribute("title", element.getAttribute("tiptext")); }); - // Children should be nested inside the previous LEGACY element - document.querySelectorAll(".CHILDREN").forEach((children) => { - const parent = children.previousElementSibling; - children.querySelectorAll(".LEGACY").forEach((child) => { - parent.appendChild(child); - }); - children.remove(); - }); + // CHILDREN should be nested into the previous LEGACY element + while (document.querySelectorAll(".CHILDREN").length > 0) { + let childElement = document.querySelector(".CHILDREN"); + let parent = childElement.previousElementSibling; + while (childElement.children.length > 0) { + parent.appendChild(childElement.children[0]); + } + childElement.remove(); + }; }; diff --git a/tools/uiscript_inspector_qt.py b/tools/uiscript_inspector_qt.py index cf6322c..fb9d36a 100755 --- a/tools/uiscript_inspector_qt.py +++ b/tools/uiscript_inspector_qt.py @@ -64,7 +64,10 @@ def uiscript_to_html(orig: str) -> str: output += line + "\n" # Replace and tags with
- output = re.sub(r'<(\w+)', r'
", "
") + output = output.replace("", "
") # tags didn't have closing tags, add one if not present output = output.replace(" >", ">")