mirror of https://github.com/zulip/zulip.git
markdown: Update regex for strikethrough.
This uses the correct regex for strikethrough. Also, added a test to make sure that strikethrough works when it contains link with whitespace. Fixes #7596.
This commit is contained in:
parent
dd406e87e9
commit
ef51a39552
|
@ -188,6 +188,12 @@
|
|||
"expected_output": "<p>I <del> like software </del> love hardware</p>",
|
||||
"text_content": "I like software love hardware"
|
||||
},
|
||||
{
|
||||
"name": "strikthrough_link",
|
||||
"input": "~~test http://xx.xx link~~",
|
||||
"expected_output": "<p><del>test <a href=\"http://xx.xx\" target=\"_blank\" title=\"http://xx.xx\">http://xx.xx</a> link</del></p>",
|
||||
"text_content": "test http://xx.xx link"
|
||||
},
|
||||
{
|
||||
"name": "underscore_disabled",
|
||||
"input": "_foo_",
|
||||
|
|
|
@ -1395,7 +1395,7 @@ class Bugdown(markdown.Extension):
|
|||
# Custom strikethrough syntax: ~~foo~~
|
||||
md.inlinePatterns.add('del',
|
||||
markdown.inlinepatterns.SimpleTagPattern(
|
||||
r'(?<!~)(\~\~)([^~{0}\n]+?)\2(?!~)', 'del'), '>strong')
|
||||
r'(?<!~)(\~\~)([^~\n]+?)(\~\~)(?!~)', 'del'), '>strong')
|
||||
|
||||
# Text inside ** must start and end with a word character
|
||||
# it need for things like "const char *x = (char *)y"
|
||||
|
|
Loading…
Reference in New Issue