Skip to content

Commit

Permalink
Fix SmartSymbols Toc test (#2344)
Browse files Browse the repository at this point in the history
Fixes #2343
  • Loading branch information
facelessuser authored Mar 26, 2024
1 parent 87e649d commit 509e93d
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/test_extensions/test_smartsymbols.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""Test cases for SmartSymbols."""
from .. import util
import markdown
from pymdownx.__meta__ import parse_version

PYMD_3_6 = parse_version(markdown.__version__) >= (3, 6, 0)


class TestSmartSymbols(util.MdCase):
Expand Down Expand Up @@ -139,4 +142,23 @@ def test_toc_tokens(self):

md = markdown.Markdown(extensions=['toc', 'pymdownx.smartsymbols'])
md.convert('# *Foo* =/= `bar`')
self.assertEqual(md.toc_tokens, [{'level': 1, 'id': 'foo-bar', 'name': 'Foo ≠ bar', 'children': []}])
self.assertEqual(
md.toc_tokens,
[
{
'children': [],
'data-toc-label': '',
'html': '<em>Foo</em> &ne; <code>bar</code>',
'id': 'foo-bar',
'level': 1,
'name': 'Foo &ne; bar'
}
] if PYMD_3_6 else [
{
'level': 1,
'id': 'foo-bar',
'name': 'Foo &ne; bar',
'children': []
}
]
)

0 comments on commit 509e93d

Please sign in to comment.