mirror of
https://github.com/colinc86/LaTeXSwiftUI.git
synced 2026-04-03 00:09:29 -06:00
[Bug] Single Dollar Sign in Text Breaks LaTeX Rendering #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @resetsix on 4/17/2025
Issue Description
When using LaTeXSwiftUI, a single dollar sign (
$) in text content (especially in code blocks) breaks the LaTeX rendering of all subsequent content. This happens because the parser seems to interpret the standalone dollar sign as the beginning of a math expression but doesn't find a matching closing delimiter.Steps to Reproduce
Current Behavior
The LaTeX content after the standalone dollar sign is not properly rendered. The parser appears to be confused by the single dollar sign in the code block, treating it as the beginning of a math expression.
Expected Behavior
The parser should be smart enough to recognize that a dollar sign within a code block (```bash) or other non-LaTeX contexts should not be treated as a math delimiter. Alternatively, it should provide a mechanism to handle these cases without requiring manual escaping by users.
Workarounds
Currently, we need to manually handle this by:
pnpm install\$ pnpm install$ pnpm install $However, these workarounds require users to modify their content, which is not ideal.
Proposed Solution
The library should be enhanced to:
Environment
Additional Context
This issue is particularly problematic when trying to render Markdown content that contains both code examples with shell commands (which often use
$as a prompt) and mathematical formulas.