Skip to content

Don't leak extracted LaTeX between markdown conversions - #3729

Open
meisterT wants to merge 1 commit into
DOMjudge:mainfrom
meisterT:latex-leak
Open

meisterT wants to merge 1 commit into
DOMjudge:mainfrom
meisterT:latex-leak

Conversation

@meisterT

Copy link
Copy Markdown
Member

The LaTeX taken out of a document before converting it was stored on the shared extension instead of the call, so a placeholder lost during conversion left its LaTeX behind for the next document rendered in the same request.

@meisterT
meisterT requested a review from vmcj September 1, 2026 15:51
The LaTeX taken out of a document before converting it was stored on the shared
extension instead of the call, so a placeholder lost during conversion left its
LaTeX behind for the next document rendered in the same request.
return preg_replace_callback(
"/$latexPlaceholder/",
fn(): string => array_shift($this->latexFound), $markdown
// A placeholder the conversion dropped leaves one behind, so do not assume there

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm probably stupid but if I don't know I'll not know in the future.. which conversions do we drop but not return '' so can still replace the $placeholder with?

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.

3 participants