sillycode
    Preparing search index...

    Function reverse

    • Generates sillycode markup from the children of a DOM element.

      This function extracts text content from DOM elements and converts it back to sillycode markup format. It handles text nodes and element nodes, joining multiple lines with newline characters.

      Parameters

      • $root: HTMLElement

        The root HTML element to extract content from

      Returns string

      The generated sillycode markup as a string

      const element = document.getElementById('editor');
      const sillycode = reverse(element);
      console.log(sillycode); // "[b]Hello[/b] world"