You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran into a problematic website with mismatched open and close tags.
It appears the following code in Parser.prototype.onclosetag tries to make better sense out of mismatched close tags by popping the open tags off the stack until reaching the tag being closed:
Sending the re-ordered tags to the browser then caused the rendering to look awful.
The question would be, is it reasonable to just attempt to reconstruct the original flawed order this by pulling out the tag?
var pos = this._stack.lastIndexOf(name);
if(pos !== -1){
this._stack.splice(pos,1);
if (this._cbs.onclosetag) {
this._cbs.onclosetag(name);
}
With this modification, ff, chrome, ie all now rendered properly with this "flawed" html. Being unaware of the potential impact to other code and scenarios that might expect the current tag closing behavior, I put this up for discussion.
The text was updated successfully, but these errors were encountered:
Understood. And certainly as I look into the issue further, there are leftover tags, etc. I guess there is a limit to much bad HTML one can "forgive". Thanks for the quick response. I'll close this then.
Ran into a problematic website with mismatched open and close tags.
It appears the following code in Parser.prototype.onclosetag tries to make better sense out of mismatched close tags by popping the open tags off the stack until reaching the tag being closed:
Sending the re-ordered tags to the browser then caused the rendering to look awful.
The question would be, is it reasonable to just attempt to reconstruct the original flawed order this by pulling out the tag?
With this modification, ff, chrome, ie all now rendered properly with this "flawed" html. Being unaware of the potential impact to other code and scenarios that might expect the current tag closing behavior, I put this up for discussion.
The text was updated successfully, but these errors were encountered: