From 345c4d2a776c3e30d0c05e5954adbfe4142f3519 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 19 Sep 2012 20:21:35 -0400 Subject: [PATCH] Update gfm so escaped text is still parsed for references --- lib/gitlab/markdown.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index 0a467a8d9c9..9201003e2e1 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -48,8 +48,10 @@ module Gitlab def gfm(text, html_options = {}) return text if text.nil? - # prevents the string supplied through the _text_ argument to be altered - text = text.dup + # Duplicate the string so we don't alter the original, then call to_str + # to cast it back to a String instead of a SafeBuffer. This is required + # for gsub calls to work as we need them to. + text = text.dup.to_str @html_options = html_options