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 &lt;.

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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -