File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
tests/test_syntax/extensions Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
1515* Include ` scripts/*.py ` in the generated source tarballs (#1430 ).
1616* Ensure lines after heading in loose list are properly detabbed (#1443 ).
17+ * Give smarty tree processor higher priority than toc (#1440 ).
1718
1819## [ 3.5.2] -- 2024-01-10
1920
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ def extendMarkdown(self, md):
269269 self .educateDashes (md )
270270 inlineProcessor = InlineProcessor (md )
271271 inlineProcessor .inlinePatterns = self .inlinePatterns
272- md .treeprocessors .register (inlineProcessor , 'smarty' , 2 )
272+ md .treeprocessors .register (inlineProcessor , 'smarty' , 6 )
273273 md .ESCAPED_CHARS .extend (['"' , "'" ])
274274
275275
Original file line number Diff line number Diff line change @@ -198,3 +198,26 @@ def test_custom_substitutions(self):
198198 'Must not be confused with ‚ndash‘ (\u2013 ) \u2026 ]</p>'
199199 )
200200 self .assertMarkdownRenders (text , html )
201+
202+
203+ class TestSmartyAndToc (TestCase ):
204+
205+ default_kwargs = {
206+ 'extensions' : ['smarty' , 'toc' ],
207+ }
208+
209+ def test_smarty_and_toc (self ):
210+ self .assertMarkdownRenders (
211+ '# *Foo* --- `bar`' ,
212+ '<h1 id="foo-bar"><em>Foo</em> — <code>bar</code></h1>' ,
213+ expected_attrs = {
214+ 'toc_tokens' : [
215+ {
216+ 'level' : 1 ,
217+ 'id' : 'foo-bar' ,
218+ 'name' : 'Foo — bar' ,
219+ 'children' : [],
220+ },
221+ ],
222+ },
223+ )
You can’t perform that action at this time.
0 commit comments