-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keys should not parse base64 encoded URLs (#2245)
- Loading branch information
1 parent
cf97b06
commit b336f93
Showing
3 changed files
with
44 additions
and
6 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Test cases for Keys.""" | ||
from .. import util | ||
|
||
|
||
class TestKeys(util.MdCase): | ||
"""Tests for Keys.""" | ||
|
||
extension = [ | ||
'pymdownx.keys' | ||
] | ||
|
||
def test_avoid_base64(self): | ||
"""Test complex case where `**text*text***` may be detected on accident.""" | ||
|
||
self.check_markdown( | ||
"![](data:image/png;base64,aaaaa++a++aaaa) ++ctrl+a++ ++ctrl+'custom'++", | ||
'<p><img alt="" src="data:image/png;base64,aaaaa++a++aaaa" /> <span class="keys"><kbd class="key-control">Ctrl</kbd><span>+</span><kbd class="key-a">A</kbd></span> <span class="keys"><kbd class="key-control">Ctrl</kbd><span>+</span><kbd>custom</kbd></span></p>' # noqa: E501 | ||
) |