Rails: render_to_string without escaping HTML chars (i.e. < and >) -
i need export strings in markdown format (that lie in database) ms word docx format. decided use pandoc this.
i have registered new mime type docx
, can stuff in show.docx.erb
file:
# <%= @boilerplate.title %> ## <%= @boilerplate.class.human_attribute_name :intro %> <%= @boilerplate.intro %> ## <%= @boilerplate.class.human_attribute_name :outro %> <%= @boilerplate.outro %>
then pandocruby.convert render_to_string(options), to: :docx
. creates nice word document.
but has problem: escapes html chars <
, >
, when have e.g. html code blocks in source, brackets escaped <
.
i need unescaped string render_to_string(options)
. possible?
related issue: https://github.com/alphabetum/pandoc-ruby/issues/14
try <%= raw @boilerplate.into %>
instead.
Comments
Post a Comment