Closed nonara closed 2 years ago
Fixed, and I do believe this would reduce the performance a bit. but it should not works incorrectly anyway. Thanks for your report. reopen this if issues are still there.
Thanks for the fast work! I think there will still be an issue, though.
<a href="#"><b><a href="#">link</a></b></a>
My plan was to track the last A tag stack index in a var, and if you hit another, it would adjust the stack from the var idx point and update the var with the new tag.
Also, when closing the A, it should unset the index var.
I'm on mobile, so I cant give a better example, but hopefully that makes sense.
Fix submitted in #148
It seems #148 caused more issues.
@nonara Do you have time to take a look at these issues?
Hi @taoqf ! Good to hear from you. Hope all is well.
I will check on the behavior of other parsers. I think how we handle it matches, but if not, I'll give some thought to the right approach and we can discuss a way to correct it
@nonara Thanks, really.
Resolved in #215
Synopsis
Given:
This is invalid HTML, and it should be parsed as:
However, it's parsed as:
This is causing issues for the markdown converter.
Spec
Spec dictates that an
A
tag cannot be a child of anotherA
.Upon encountering a nested A tag, the parser should consider the present tag terminated and begin a new one. Any further text that occurs after (ie.
end
, should be considered a TextNode)This behaviour can be demonstrated via: https://astexplorer.net
Solution
I believe this should be easily solvable, without a performance impact. I will investigate this ASAP and submit a fix. I hope to get to it this weekend.
Related