Skip to content

Fix extracting links after <pre><code></code></pre>#1911

Merged
mre merged 1 commit intomasterfrom
fix-1905
Nov 11, 2025
Merged

Fix extracting links after <pre><code></code></pre>#1911
mre merged 1 commit intomasterfrom
fix-1905

Conversation

@mre
Copy link
Member

@mre mre commented Nov 11, 2025

Fixes #1905

The problem was that the EndTag event handler was checking if last_verbatim == &self.current_element, but self.current_element was never updated during EndTag events - it only got set during OpenStartTag events. This meant when </code> was processed, it couldn't match against the verbatim stack to pop it, leaving the verbatim flag incorrectly active for subsequent content.

@mre mre requested a review from thomas-zahner November 11, 2025 11:14
Fixes #1905

The problem was that the EndTag event handler was checking if `last_verbatim ==
&self.current_element`, but `self.current_element` was never updated during
EndTag events - it only got set during OpenStartTag events. This meant when
`</code>` was processed, it couldn't match against the verbatim stack to pop it,
leaving the verbatim flag incorrectly active for subsequent content.
@thomas-zahner
Copy link
Member

Cool, I don't see any problems 👍

@mre mre merged commit 35a061c into master Nov 11, 2025
7 checks passed
@mre mre deleted the fix-1905 branch November 11, 2025 12:55
@mre
Copy link
Member Author

mre commented Nov 11, 2025

Nice. Thanks for the quick review.

@mre mre mentioned this pull request Nov 11, 2025
@mre mre mentioned this pull request Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lychee does not find links after <pre><code></code></pre>

2 participants