Repository navigation
fix: no space before the punctuation after a formula - #2849
Merged
Merged
Conversation
scour ends the SVG with a newline, which shows as a space in the HTML: "formula , text".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit was meant to be part of #2847 but reached my branch after the merge.
scour ends the optimized SVG with a newline, and in the HTML that shows as a space between a formula and the punctuation after it: "формулой X , где", "кислота (X ), использующаяся". In RU that's 149 places.
The fix strips the trailing whitespace in
svg.optimize(), andtest_formula_to_svgnow checks that the SVG ends with</svg>.Testing
python:3.13-slim, RU dump 2026-11-01main(f0bf952), then compared the StarDict output with a build that has this commit: the only differences are those 149 newlines after a formula, plus 7 places where a formula followed by an em dash gets its non-breaking space backtest_formula_to_svg,ruffandmypypass