| Title | Wrong index in tag cleanup |
|---|---|
| Author | Rodrigo Arias Mallo |
| Created | Sat, 17 Oct 2026 21:20:16 +0200 |
| State | open |
After my attempt to fix the wrong usage of the index in
Html_tag_cleanup_at_close:
--- a/src/html.cc
+++ b/src/html.cc
@@ -3831,7 +3831,7 @@ static void Html_tag_cleanup_at_close(DilloHtml *html, int new_idx)
/* Let these elements close anything left open inside them */
continue;
} else if (Tags[new_idx].Flags & 4 && // Block container
- Tags[stack_idx].Flags & 3) { // Inline element or container
+ Tags[new_idx].Flags & 3) { // Inline element or container
/* Let a block container close inline elements left open inside it. */
continue;
} else {
The new_idx may not be the right index, instead tag_idx should be used.
Reported-by: dogma
This test file can exhibit the issue, causing the
emandbelements no to auto-close.Changing
new_idxtotag_idxcauses them to properly close and display the last text as normal, but this behavior is not what Firefox or Chromium does. We may want to revisit the standard to see what we should do.In any case, using the
new_idxvariable as index is wrong.