Commit 513d6a84 authored by Reuben Pereira's avatar Reuben Pereira

Use literal '>' as escaped form of '>'

parent e5338263
...@@ -460,6 +460,10 @@ class Project < ActiveRecord::Base ...@@ -460,6 +460,10 @@ class Project < ActiveRecord::Base
'>' '>'
end end
def reference_postfix_escaped
'&gt;'
end
# Pattern used to extract `namespace/project>` project references from text. # Pattern used to extract `namespace/project>` project references from text.
# (?!\w) matches any non-word character. # (?!\w) matches any non-word character.
# '>' or its escaped form ('&gt;') are checked for because '>' is sometimes escaped # '>' or its escaped form ('&gt;') are checked for because '>' is sometimes escaped
...@@ -467,7 +471,7 @@ class Project < ActiveRecord::Base ...@@ -467,7 +471,7 @@ class Project < ActiveRecord::Base
def markdown_reference_pattern def markdown_reference_pattern
%r{ %r{
#{reference_pattern} #{reference_pattern}
(#{reference_postfix}|#{CGI.escapeHTML(reference_postfix)}) (#{reference_postfix}|#{reference_postfix_escaped})
(?!\w) (?!\w)
}x }x
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment