File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
mdformat_mkdocs/mdit_plugins Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 17
17
ut eros sed sapien ullamcorper consequat. Nunc ligula ante.
18
18
19
19
Duis mollis est eget nibh volutpat, fermentum aliquet dui mollis.
20
- Nam vulputate tincidunt fringilla.
20
+ Vulputate tincidunt fringilla.
21
21
Nullam dignissim ultrices urna non auctor.
22
22
```
23
23
28
28
29
29
from __future__ import annotations
30
30
31
+ import re
31
32
from typing import TYPE_CHECKING
32
33
33
34
from markdown_it import MarkdownIt
@@ -106,6 +107,7 @@ def escape_deflist(
106
107
context : RenderContext , # noqa: ARG001
107
108
) -> str :
108
109
"""Escape line starting ":" which would otherwise be parsed as a definition list."""
110
+ pattern = re .compile (r"^[:~] " )
109
111
return "\n " .join (
110
- "\\ " + line if line . startswith ( ":" ) else line for line in text .split ("\n " )
112
+ "\\ " + line if pattern . match ( line ) else line for line in text .split ("\n " )
111
113
)
Original file line number Diff line number Diff line change
1
+ Prevent regression with non-deflists: https://github.com/KyleKing/mdformat-mkdocs/issues/56
2
+ .
3
+ ::: my_lib.core
4
+ .
5
+ ::: my_lib.core
6
+ .
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ def flatten(nested_list: list[list[T]]) -> list[T]:
27
27
"pymd_abbreviations.md" ,
28
28
"pymd_snippet.md" ,
29
29
"python_markdown_attr_list.md" ,
30
+ "regression.md" ,
30
31
"text.md" ,
31
32
)
32
33
],
You can’t perform that action at this time.
0 commit comments