fixes for wiki links

This commit is contained in:
albert
2013-02-19 22:23:14 -05:00
parent 16c92c045a
commit 2f72e99ed7

View File

@@ -48,16 +48,16 @@ class DText
def self.parse_aliased_wiki_links(str)
str.gsub(/\[\[([^\|\]]+)\|([^\]]+)\]\]/m) do
text = CGI.unescapeHTML($2).tr("_", " ")
title = CGI.unescapeHTML($1)
text = CGI.unescapeHTML($2)
title = CGI.unescapeHTML($1).tr(" ", "_").downcase
%{<a href="/wiki_pages/show_or_new?title=#{u(title)}">#{h(text)}</a>}
end
end
def self.parse_wiki_links(str)
str.gsub(/\[\[([^\]]+)\]\]/) do
title = CGI.unescapeHTML($1)
text = title.tr("_", " ")
text = CGI.unescapeHTML($1)
title = text.tr(" ", "_").downcase
%{<a href="/wiki_pages/show_or_new?title=#{u(title)}">#{h(text)}</a>}
end
end