mirror of https://github.com/zulip/zulip.git
bugdown: TLD and parentheses shouldn't make it a link. Trac #1364
(imported from commit d4da7ec080a6a8362b6370ced9ddc10d52443452)
This commit is contained in:
parent
11e44c68ce
commit
334424ae79
|
@ -565,7 +565,7 @@ class Bugdown(markdown.Extension):
|
||||||
# This rule must come after the http_autolink rule we add above to avoid double
|
# This rule must come after the http_autolink rule we add above to avoid double
|
||||||
# linkifying.
|
# linkifying.
|
||||||
tlds = '|'.join(list_of_tlds())
|
tlds = '|'.join(list_of_tlds())
|
||||||
link_regex = r"\b(?P<url>[^\s]+\.(%s)(?:/[^\s()\":]*?|([^\s()\":]*\([^\s()\":]*\)[^\s()\":]*))?)(?=([:;\?\),\.\'\"]\Z|[:;\?\),\.\'\"]\s|\Z|\s))" % (tlds,)
|
link_regex = r"\b(?P<url>[^\s]+\.(%s)(?:/[^\s()\":]*?|(/[^\s()\":]*\([^\s()\":]*\)[^\s()\":]*))?)(?=([:;\?\),\.\'\"]\Z|[:;\?\),\.\'\"]\s|\Z|\s))" % (tlds,)
|
||||||
md.inlinePatterns.add('autolink', AutoLink(link_regex), '>http_autolink')
|
md.inlinePatterns.add('autolink', AutoLink(link_regex), '>http_autolink')
|
||||||
|
|
||||||
md.preprocessors.add('hanging_ulists',
|
md.preprocessors.add('hanging_ulists',
|
||||||
|
|
|
@ -2139,7 +2139,11 @@ int x = 3
|
||||||
# to avoid triggering the inline image preview support
|
# to avoid triggering the inline image preview support
|
||||||
('http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov',
|
('http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov',
|
||||||
"<p>%s</p>",
|
"<p>%s</p>",
|
||||||
'http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov')]
|
'http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov'),
|
||||||
|
|
||||||
|
# Just because it has a TLD and parentheses in it doesn't mean it's a link. Trac #1364
|
||||||
|
('a.commandstuff()', '<p>a.commandstuff()</p>', ''),
|
||||||
|
]
|
||||||
|
|
||||||
for inline_url, reference, url in conversions:
|
for inline_url, reference, url in conversions:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue