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

How can I parse a document with errors in the closing of tags? #225

Open
jpolstre opened this issue Oct 18, 2022 · 1 comment
Open

How can I parse a document with errors in the closing of tags? #225

jpolstre opened this issue Oct 18, 2022 · 1 comment

Comments

@jpolstre
Copy link

Example:

var doc = nodeParse('
<html>
   <body>
     <table>
        <tbody>
            <tr>
              <td>
                 <a href="#" class="anchor" >link</a>
             <td>
          <tr>
          <tbody>// error close tag
       </table>
    </body>
 </html>')

var anchor = doc.querySelector('.anchor')
console.log(anchor.parentNode.parentNode.parentNode) //Returns <html..., when <tbody.. is expected.

In other languages ​​and with other packages I have no problem. I also don't want to be putting: voidTag:{
tags: ['area', 'base',...], in the configuration, since I don't know in which labels the error will appear. Is there a way to do what I'm looking for? Thank you for your package.

@taoqf
Copy link
Owner

taoqf commented Aug 17, 2023

#152
#231
too many issues about broken html, I really have no time on this. pr is welcomed.

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

No branches or pull requests

2 participants