diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-06-21 00:33:01 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-06 02:57:09 +0300 |
commit | ab811b6ab929d3f220e060c15c49bc075d91e5f2 (patch) | |
tree | bbe8091322f85e1bdc9c5a91597f4723edf4f51b /lib/banzai | |
parent | e186626d25d5a24e2f2c5f0b5082b79bc8bd0ddf (diff) |
Render references for labels that name contains ?, or &
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/label_reference_filter.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/banzai/filter/label_reference_filter.rb b/lib/banzai/filter/label_reference_filter.rb index e4d3f87d0aa..7d016d78669 100644 --- a/lib/banzai/filter/label_reference_filter.rb +++ b/lib/banzai/filter/label_reference_filter.rb @@ -13,13 +13,13 @@ module Banzai end def self.references_in(text, pattern = Label.reference_pattern) - text.gsub(pattern) do |match| + unescape_html_entities(text).gsub(pattern) do |match| yield match, $~[:label_id].to_i, $~[:label_name], $~[:project], $~ end end def references_in(text, pattern = Label.reference_pattern) - text.gsub(pattern) do |match| + unescape_html_entities(text).gsub(pattern) do |match| label = find_label($~[:project], $~[:label_id], $~[:label_name]) if label @@ -66,6 +66,10 @@ module Banzai LabelsHelper.render_colored_cross_project_label(object) end end + + def unescape_html_entities(text) + LabelsHelper.unescape_html_entities(text) + end end end end |