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

Fixed issue with INLINE_MATH_TEX regex to accept spaces within inline #2188

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion nbconvert/filters/markdown_mistune.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ class MathInlineParser(InlineParser):
# Display math mode, using newer LaTeX delimiter: \[ \pi \]
BLOCK_MATH_LATEX = _dotall(r"(?<!\\)\\\\\[(?P<math_block_latex>.*?)(?<!\\)\\\\\]")
# Inline math mode, using older TeX delimiter: $ \pi $ (cannot be empty!)
INLINE_MATH_TEX = _dotall(r"(?<![$\\])\$(?P<math_inline_tex>.+?)(?<![$\\])\$")
INLINE_MATH_TEX = _dotall(
r"(?<![$\\])$(?!\s)(?P<math_inline_tex>[^$\\\s]+?)(?<!\s)(?<![$\\])$"
)
# Inline math mode, using newer LaTeX delimiter: \( \pi \)
INLINE_MATH_LATEX = _dotall(r"(?<!\\)\\\\\((?P<math_inline_latex>.*?)(?<!\\)\\\\\)")
# LaTeX math environment: \begin{equation} \pi \end{equation}
Expand Down
Loading