Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null root node when parsing the following #272

Open
lilezek opened this issue Mar 8, 2024 · 0 comments
Open

null root node when parsing the following #272

lilezek opened this issue Mar 8, 2024 · 0 comments

Comments

@lilezek
Copy link

lilezek commented Mar 8, 2024

I have the following code:

const elements = htmlOrXml.map(s => parse(s.trim())); 
console.log(elements[5].structure, `'${htmlOrXml[5]}'`);

Outputing this:

null
  button#button.style-scope.yt-icon-button
    yt-icon#guide-icon.style-scope.ytd-masthead
      yt-icon-shape.style-scope.yt-icon
        icon-shape.yt-spec-icon-shape
          div
            svg
              path '<button id="button" class="style-scope yt-icon-button" aria-label="Guide">
          <yt-icon id="guide-icon" icon="yt-icons:menu" class="style-scope ytd-masthead"><yt-icon-shape class="style-scope yt-icon"><icon-shape class="yt-spec-icon-shape"><div style="width: 100%; height: 100%; fill: currentcolor;"><svg xml
ns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" focusable="false" style="pointer-events: none; display: block; width: 100%; height: 100%;"><path d="M21 6H3V5h18v1zm0 5H3v1h18v-1zm0 6H3v1h18v-1z"></path></svg></di
v></icon-shape></yt-icon-shape></yt-icon>
        </button>'

Is the null root expected? In the documentation there is no null root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant