Escape lisp-quoted wiki links.

This commit is contained in:
Tom Preston-Werner
2010-07-08 19:04:36 -07:00
parent 9e3a307aa8
commit 2c2bf68a3b
2 changed files with 30 additions and 4 deletions
+8 -4
View File
@@ -44,10 +44,14 @@ module Gollum
#
# Returns the placeholder'd String data.
def extract_tags(data)
data.gsub(/\[\[(.+?)\]\]/m) do
id = Digest::SHA1.hexdigest($1)
@tagmap[id] = $1
id
data.gsub(/(.?)\[\[(.+?)\]\](.?)/m) do
if $1 == "'" && $3 != "'"
"[[#{$2}]]#{$3}"
else
id = Digest::SHA1.hexdigest($2)
@tagmap[id] = $2
"#{$1}#{id}#{$3}"
end
end
end