Show clearer error message on WikiCloth exception

This commit is contained in:
Julius 2013-12-22 23:34:54 +01:00
parent 42e983f7ee
commit 3bf1392251
3 changed files with 4 additions and 4 deletions

View file

@ -4,8 +4,8 @@ module PagesHelper
def wikified_body(body, title = nil)
render_opts = {:locale => I18n.locale} # workaround for wikicloth 0.8.0 https://github.com/nricciar/wikicloth/pull/59
WikiCloth.new({:data => body+"\n", :link_handler => Wikilink.new, :params => {:referer => title}}).to_html(render_opts).html_safe
rescue
"<span class='alert alert-error'>#{t '.wikicloth_exception'}</span>".html_safe # try the following with line breaks: === one === == two == = three =
rescue => e
"<span class='alert alert-error'>#{t('.wikicloth_exception', :msg => e)}</span>".html_safe # try the following with line breaks: === one === == two == = three =
end
def link_to_wikipage(page, text = nil)