Skip to content

Inline LaTeX fails to render when nested inside Markdown emphasis, highlight (==), underline (__ or <ins>), or other inline formatting #753

@Xanaxus

Description

@Xanaxus

Search first

  • I searched and no similar issues were found

What Happened?

Inline LaTeX (both $...$ and $$...$$) does not render at all when the math delimiters are wrapped in (or touching) certain Markdown inline formatting spans. Instead, the raw dollar signs and content are displayed as plain text.

Reproduce the Bug

  1. Create a new blank block.
  2. Type any of these examples:
    • Plain (works): The x stock is $\uparrow$ trending
      → Renders correctly as: The x stock is ↑ trending
    • Failing cases — all show raw $...$:
      • The x stock is **$\uparrow$** (bold)
      • The x stock is *$\uparrow$* (italic)
      • The x stock is ==$\uparrow$== (highlight)
      • The x stock is <ins>$\uparrow$</ins> (underline)
      • ==The x stock is $\uparrow$== (highlight wrapping whole phrase)

Expected Behavior

LaTeX should render normally inside inline emphasis/highlight/underline spans, just as it does in plain text. The KaTeX processor should be applied after (or independently of) Markdown inline styling.

Files

No response

Browser, Desktop or Mobile Platform Information

  • Logseq Version: 2.0.0 (build 88)
  • OS: MacOS

Additional Context

Workarounds (temporary)

  • Keep math outside of emphasis spans
  • Use plain text + Unicode arrows (↑) without LaTeX when emphasis is needed
  • Avoid / == for math-containing text

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions