redcloth
redcloth copied to clipboard
HTML Template Engine codes are converted to html
In our application we accept HTML template codes in Email templates, when we try to convert them to html using RedCloth, It converts HTML template code open close %
symbol to <span>
due to this our Email client throws error while processing the if else block. Example: template
<p dir=\"ltr\">{% if some_condition %}</p><ul dir=\"ltr\"><li dir=\"ltr\">Unordered list element1</li></ul><p dir=\"ltr\">{% else %}</p><ul dir=\"ltr\"><li dir=\"ltr\">Unordered list element2</li></ul><p dir=\"ltr\">{% endif %}</p><p dir=\"ltr\"><br></p>
Converting this to html using RedCloth results below content (Else and Endif blocks are converted to <span>
)
2.2.5 :053 > RedCloth.new( content ).to_html
=> "<p dir=\"ltr\">{% if some_condition %}</p><ul dir=\"ltr\"><li dir=\"ltr\">Unordered list element1</li><p></ul><p dir=\"ltr\">{% else <span>}</p><ul dir=\"ltr\"><li dir=\"ltr\">Unordered list element2</li></ul><p dir=\"ltr\">{</span> endif %}</p><p dir=\"ltr\"><br></p></p>"
I doubt this might be bug, so raising one here. Can someone please suggest any work around for this issue. Because it is affecting our Email trigger workflow
p>The sun is reportedly hot,1 just like freshly baked potatoes.1 Ice is cold.2
- a b Ouch.
- a Brrr.