-
Notifications
You must be signed in to change notification settings - Fork 864
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backslash Unescape IDs set via
attr_list
on toc
Fixes #1493.
- Loading branch information
Showing
4 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -974,6 +974,32 @@ def test_escaped_char_in_id(self): | |
extensions=['toc'] | ||
) | ||
|
||
def test_escaped_char_in_attr_list(self): | ||
self.assertMarkdownRenders( | ||
r'# `*Foo*` { id="\*Foo\*" }', | ||
'<h1 id="*Foo*"><code>*Foo*</code></h1>', | ||
expected_attrs={ | ||
'toc': ( | ||
'<div class="toc">\n' | ||
'<ul>\n' # noqa | ||
'<li><a href="#*Foo*">*Foo*</a></li>\n' # noqa | ||
'</ul>\n' # noqa | ||
'</div>\n' # noqa | ||
), | ||
'toc_tokens': [ | ||
{ | ||
'level': 1, | ||
'id': '*Foo*', | ||
'name': '*Foo*', | ||
'html': '<code>*Foo*</code>', | ||
'data-toc-label': '', | ||
'children': [] | ||
} | ||
] | ||
}, | ||
extensions=['toc', 'attr_list'] | ||
) | ||
|
||
def testAutoLinkEmail(self): | ||
self.assertMarkdownRenders( | ||
'## <[email protected]>', | ||
|