Skip to content

Fix HTML content escaping#2648

Merged
ChristianGruen merged 1 commit intoBaseXdb:mainfrom
GuntherRademacher:#2645
Apr 22, 2026
Merged

Fix HTML content escaping#2648
ChristianGruen merged 1 commit intoBaseXdb:mainfrom
GuntherRademacher:#2645

Conversation

@GuntherRademacher
Copy link
Copy Markdown
Member

In HTMLSerializer.finishEmpty, script++ was incremented for empty <script>/<style> elements, but finishClose (which does script--) is never called for empty elements. This left script > 0 permanently, suppressing text escaping for the rest of the document.

Minimal reproduction:

declare option output:method 'html';
declare option output:html-version '5.0';
<html><head><script src="x.js"/></head><body>{ '<tag>' }</body></html>

Expected: &lt;tag&gt;
Actual: <tag>

This regression was introduced by a168d7f on behalf of #2575.

@ChristianGruen ChristianGruen merged commit 09609fd into BaseXdb:main Apr 22, 2026
1 check passed
@ChristianGruen ChristianGruen deleted the #2645 branch April 22, 2026 07:28
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.

2 participants