Prevent gfm() to leak changes to the string supplied through the _text_ argument

This commit is contained in:
Riyad Preukschas 2012-09-08 01:58:12 +02:00
parent ce3fb94939
commit d661b893c5

View file

@ -48,6 +48,9 @@ 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
@html_options = html_options
# Extract pre blocks so they are not altered