Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
6024c5cd
Commit
6024c5cd
authored
Sep 05, 2014
by
Koosha KM
Committed by
David Lawrence
Sep 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1060308: Markdown: URLs and Emails are not rendered literally in code spans and code blocks
r=glob,a=sgreen
parent
cf8e842b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
Markdown.pm
Bugzilla/Markdown.pm
+6
-1
No files found.
Bugzilla/Markdown.pm
View file @
6024c5cd
...
@@ -47,6 +47,7 @@ our %g_escape_table;
...
@@ -47,6 +47,7 @@ our %g_escape_table;
foreach
my
$char
(
split
//
,
'\\`*_{}[]()>#+-.!~'
)
{
foreach
my
$char
(
split
//
,
'\\`*_{}[]()>#+-.!~'
)
{
$g_escape_table
{
$char
}
=
md5_hex
(
$char
);
$g_escape_table
{
$char
}
=
md5_hex
(
$char
);
}
}
$g_escape_table
{
'<'
}
=
md5_hex
(
'<'
);
sub
new
{
sub
new
{
my
$invocant
=
shift
;
my
$invocant
=
shift
;
...
@@ -149,7 +150,7 @@ sub _StripLinkDefinitions {
...
@@ -149,7 +150,7 @@ sub _StripLinkDefinitions {
sub
_DoAutoLinks
{
sub
_DoAutoLinks
{
my
(
$self
,
$text
)
=
@_
;
my
(
$self
,
$text
)
=
@_
;
$text
=~
s{(?:<|<)((?:https?|ftp):[^'">\s]+)(?:>|>)}{<a href="$1">$1</a>}gi
;
$text
=~
s{(?:<|<)((?:https?|ftp):[^'">\s]+
?
)(?:>|>)}{<a href="$1">$1</a>}gi
;
return
$text
;
return
$text
;
}
}
...
@@ -406,8 +407,11 @@ sub _EncodeCode {
...
@@ -406,8 +407,11 @@ sub _EncodeCode {
# In other words, html_quote() will change '>' to '&gt;' and then we will
# In other words, html_quote() will change '>' to '&gt;' and then we will
# change '&gt' -> '>' -> '>' if we write this substitution as the first one.
# change '&gt' -> '>' -> '>' if we write this substitution as the first one.
$text
=~
s/&/&/g
;
$text
=~
s/&/&/g
;
$text
=~
s{<a \s+ href="(?:mailto:)? (.+?)"> \1 </a>}{$1}xmgi
;
$text
=
$self
->
SUPER::
_EncodeCode
(
$text
);
$text
=
$self
->
SUPER::
_EncodeCode
(
$text
);
$text
=~
s/~/$g_escape_table{'~'}/go
;
$text
=~
s/~/$g_escape_table{'~'}/go
;
# Encode '<' to prevent URLs from getting linkified in code spans
$text
=~
s/</$g_escape_table{'<'}/go
;
return
$text
;
return
$text
;
}
}
...
@@ -426,6 +430,7 @@ sub _UnescapeSpecialChars {
...
@@ -426,6 +430,7 @@ sub _UnescapeSpecialChars {
$text
=
$self
->
SUPER::
_UnescapeSpecialChars
(
$text
);
$text
=
$self
->
SUPER::
_UnescapeSpecialChars
(
$text
);
$text
=~
s/$g_escape_table{'~'}/~/go
;
$text
=~
s/$g_escape_table{'~'}/~/go
;
$text
=~
s/$g_escape_table{'<'}/</go
;
return
$text
;
return
$text
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment