File tree 3 files changed +25
-1
lines changed
tests/test_syntax/extensions
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
14
14
15
15
* Include ` scripts/*.py ` in the generated source tarballs (#1430 ).
16
16
* Ensure lines after heading in loose list are properly detabbed (#1443 ).
17
+ * Give smarty tree processor higher priority than toc (#1440 ).
17
18
18
19
## [ 3.5.2] -- 2024-01-10
19
20
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ def extendMarkdown(self, md):
269
269
self .educateDashes (md )
270
270
inlineProcessor = InlineProcessor (md )
271
271
inlineProcessor .inlinePatterns = self .inlinePatterns
272
- md .treeprocessors .register (inlineProcessor , 'smarty' , 2 )
272
+ md .treeprocessors .register (inlineProcessor , 'smarty' , 6 )
273
273
md .ESCAPED_CHARS .extend (['"' , "'" ])
274
274
275
275
Original file line number Diff line number Diff line change @@ -198,3 +198,26 @@ def test_custom_substitutions(self):
198
198
'Must not be confused with ‚ndash‘ (\u2013 ) \u2026 ]</p>'
199
199
)
200
200
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