Skip to content

Conversation

jvoisin
Copy link
Collaborator

@jvoisin jvoisin commented Oct 11, 2025

The issue with slices.Contains is that it keeps growing and never shrinks. An rss entry could start with a bunch of random tags, and those would always be considered valid in the case html.EndTagToken case.

While can't use a strict push/pop queue, as we might have things like that are valid HTML, we can look in the slice for the farther index of the tag that is being closed, and pop everything after it.

I ran some local lightweight tests, but it might break things, beware.

The issue with slices.Contains is that it keeps growing and never shrinks. An
rss entry could start with a bunch of random tags, and those would always be
considered valid in the `case html.EndTagToken` case.

While can't use a strict push/pop queue, as we might have things like
<video><source></video> that are valid HTML, we can look in the slice for the
farther index of the tag that is being closed, and pop everything after it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant