Skip to content

fix(math): leave MathML whitespace alone during cleanup - #424

Closed
RovshanMuradov wants to merge 1 commit into
kepano:mainfrom
RovshanMuradov:fix/mathml-text-normalization
Closed

RovshanMuradov wants to merge 1 commit into
kepano:mainfrom
RovshanMuradov:fix/mathml-text-normalization

Conversation

@RovshanMuradov

@RovshanMuradov RovshanMuradov commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #422

removeEmptyLines treated MathML as prose: it moved spaces across token boundaries (A B ! → A B!) and rewrote newlines in TeX annotations, which breaks % line comments. <math> is now skipped like pre and code.

On six arXiv HTML papers this fixes 34 altered TeX annotations.

@RovshanMuradov
RovshanMuradov marked this pull request as ready for review October 12, 2026 07:28
@RovshanMuradov
RovshanMuradov marked this pull request as draft October 12, 2026 08:30
@RovshanMuradov
RovshanMuradov force-pushed the fix/mathml-text-normalization branch from b4f587d to 1167f95 Compare October 12, 2026 16:47
@RovshanMuradov RovshanMuradov changed the title fix(math): respect MathML text boundaries during cleanup fix(math): keep MathML token and annotation text during cleanup Oct 12, 2026
@RovshanMuradov
RovshanMuradov force-pushed the fix/mathml-text-normalization branch from 1167f95 to d1682b6 Compare October 12, 2026 17:50
@RovshanMuradov RovshanMuradov changed the title fix(math): keep MathML token and annotation text during cleanup fix(math): leave MathML whitespace alone during cleanup Oct 12, 2026
removeEmptyLines treated MathML as prose: it moved spaces across token
boundaries (A B !) and rewrote TeX annotations, which breaks line
comments. Skip <math> like pre and code.
@RovshanMuradov
RovshanMuradov force-pushed the fix/mathml-text-normalization branch from d1682b6 to cf75ce1 Compare October 12, 2026 18:05
@RovshanMuradov
RovshanMuradov marked this pull request as ready for review October 12, 2026 18:22
@RovshanMuradov

Copy link
Copy Markdown
Contributor Author

Closing to keep the review queue small: on six real arXiv HTML papers this only changes newlines to spaces in TeX annotations, which is TeX-equivalent, so nothing renders differently and Markdown/data-latex are unaffected. The harmful case (a % line comment) I haven't found on a real page. Happy to reopen if a real page needs it.

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.

Prose cleanup changes MathML token text and TeX annotation source

1 participant