Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math expressions cause unnecessary horizontal scroll in rendered MD #11152

Open
annoyedhumanoid opened this issue Sep 28, 2024 · 1 comment
Open
Labels
bug It's a bug desktop All desktop platforms high High priority issues

Comments

@annoyedhumanoid
Copy link

Operating system

macOS

Joplin version

3.0.15

Desktop version info

Joplin 3.0.15 (prod, darwin)

Client ID: 11cb0a2d420047cd9119a44d443e827c
Sync Version: 3
Profile Version: 47
Keychain Supported: Yes

Revision: 598677b

Backup: 1.4.1

Current behaviour

  1. Enable math expressions in Settings > Markdown
  2. Create an overflowing block element with horizontal scroll
  3. In that element, include a math expression, e.g., $a$. (The bug occurs for many, but not all, possible placements of this math expression.)
  4. With a narrow enough rendered markdown window, the viewer unnecessarily has horizontal scroll in addition to the overflowing element.

The bug appears to come from the absolute positioning of the span with class katex-mathml (see attached screen recording). To use the provided test file, open it in Joplin via File > Import > MD - Markdown (File).

https://github.com/user-attachments/assets/90561433-3dff-4ed5-bbe3-8efc7849a10e
test.md

Expected behaviour

The rendered markdown viewer should not horizontally scroll to a blank canvas. See the included screen recording, when the position: absolute; rule is turned off on the offending span.

Logs

No response

@annoyedhumanoid annoyedhumanoid added the bug It's a bug label Sep 28, 2024
@laurent22 laurent22 added desktop All desktop platforms high High priority issues labels Sep 29, 2024
@personalizedrefrigerator
Copy link
Collaborator

This might be an upstream issue — the position: absolute; is present in the generated math on the KaTeX website:
screenshot of katex.org: Shows position: absolute style present on the katex-mathml span

Possible downstream fixes:

  • Set position: relative on span.katex elements.
  • Override position: absolute and set display to inline-block on span.katex-mathml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms high High priority issues
Projects
None yet
Development

No branches or pull requests

3 participants