Skip to content

Port upstream Muya inline math scrollbar fix#62

Open
Renakoni wants to merge 1 commit into
mainfrom
sync/upstream-4839-inline-math-scrollbar
Open

Port upstream Muya inline math scrollbar fix#62
Renakoni wants to merge 1 commit into
mainfrom
sync/upstream-4839-inline-math-scrollbar

Conversation

@Renakoni

@Renakoni Renakoni commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Port upstream MarkText PR #4839 into the Android Muya copy.
  • Prevent KaTeX inline math ending in subscript/superscript nodes from producing a stray horizontal scrollbar.
  • Scope the CSS to .mu-math > .mu-math-render so the fix only affects rendered inline math inside the editor.

Upstream Source

Android Relevance

This is relevant to Android because the Android editor renders Muya inline math inside the WebView. The upstream bug is caused by KaTeX layout internals: .vlist-s contributes extra scroll width and .vlist-t2 uses a negative right margin that fixes visible layout but leaves scrollWidth wider than the rendered formula. Since Muya's inline math render container allows horizontal overflow, short formulas ending in subscript/superscript can show an unnecessary scrollbar.

Change Details

  • Zero .katex .vlist-s width and min-width inside Muya inline math render output.
  • Reset .katex .vlist-t2 right margin in the same scoped render path.
  • Kept the change local to the existing Muya inline syntax stylesheet instead of introducing a separate Android override.

Verification

  • pnpm build passed before commit on this branch.

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.

1 participant