Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions docs/src/markdown/about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ icon: lucide/scroll-text
---
# Changelog

## 10.19.1

- **FIX**: Arithmatex: Fix issue where block `$$` math used inline within a paragraph could result in nested math
parsing.

## 10.19

- **NEW**: Emoji: Update Twemoji to use Unicode 16.
Expand Down
2 changes: 1 addition & 1 deletion pymdownx/__meta__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,5 @@ def parse_version(ver: str) -> Version:
return Version(major, minor, micro, release, pre, post, dev)


__version_info__ = Version(10, 19, 0, "final")
__version_info__ = Version(10, 19, 1, "final")
__version__ = __version_info__._get_canonical()
6 changes: 3 additions & 3 deletions pymdownx/arithmatex.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
from . import util
import re

RE_SMART_DOLLAR_INLINE = r'(?:(?<!\\)((?:\\{2})+)(?=\$)|(?<!\\)(\$)(?!\s)((?:\\.|[^\\$])+?)(?<!\s)(?:\$))'
RE_DOLLAR_INLINE = r'(?:(?<!\\)((?:\\{2})+)(?=\$)|(?<!\\)(\$)((?:\\.|[^\\$])+?)(?:\$))'
RE_BRACKET_INLINE = r'(?:(?<!\\)((?:\\{2})+?)(?=\\\()|(?<!\\)(\\\()((?:\\[^)]|[^\\])+?)(?:\\\)))'
RE_SMART_DOLLAR_INLINE = r'(?:(?<!\\)((?:\\{2})+)(?=\$)|(?<!\\)(\$)(?!\s)((?:\\.|[^\\$\x02\x03])+?)(?<!\s)(?:\$))'
RE_DOLLAR_INLINE = r'(?:(?<!\\)((?:\\{2})+)(?=\$)|(?<!\\)(\$)((?:\\.|[^\\$\x02\x03])+?)(?:\$))'
RE_BRACKET_INLINE = r'(?:(?<!\\)((?:\\{2})+?)(?=\\\()|(?<!\\)(\\\()((?:\\[^)]|[^\\\x02\x03])+?)(?:\\\)))'

RE_DOLLAR_BLOCK = r'(?P<dollar>[$]{2})(?P<math>((?:\\.|[^\\])+?))(?P=dollar)'
RE_TEX_BLOCK = r'(?P<math2>\\begin\{(?P<env>[a-z]+\*?)\}(?:\\.|[^\\])+?\\end\{(?P=env)\})'
Expand Down
13 changes: 11 additions & 2 deletions tests/test_extensions/test_arithmatex.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,18 @@ def test_double_escaped_bracket_block(self):
True
)

def test_nested_inline_dollar(self):
"""Test nested inline dollar."""

class TestArithmatexHang(util.MdCase):
"""Test hang cases."""
self.check_markdown(
R'''
a $$x$$ b
''',
R'''
<p>a $<span class="arithmatex"><span class="MathJax_Preview">x</span><script type="math/tex">x</script></span>$ b</p>
''', # noqa: E501
True
)

def test_hang_dollar(self):
"""
Expand Down