Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Template Engine codes are converted to html #60

Open
Ramesh-Veeriaperumal opened this issue Feb 14, 2020 · 1 comment
Open

HTML Template Engine codes are converted to html #60

Ramesh-Veeriaperumal opened this issue Feb 14, 2020 · 1 comment

Comments

@Ramesh-Veeriaperumal
Copy link

Ramesh-Veeriaperumal commented Feb 14, 2020

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

@Ramesh-Veeriaperumal Ramesh-Veeriaperumal changed the title Erb codes are converted to html HTML Template Engine codes are converted to html Feb 18, 2020
@GregThoma
Copy link

p>The sun is reportedly hot,1 just like freshly baked potatoes.1 Ice is cold.2

  1. a b Ouch.
  2. a Brrr.
RedCloth 4.3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants