You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use handlebars with Mpdf, which reads html and converts to pdf.
I have a large set of values, SOME may have newlines in them \n, some may not. They currently do not carry through, meaning some values will not have their new lines represented properly.
I'm currently stuck with two choices, both are ugly workarounds:
Convert all newline characters in values to <br /> in advance, and then make ALL the Handlebars placeholders three brackets. This is undesirable as the template will be a pain to read, two brackets is plenty enough to deal with
Try to do use a global css rule that uses white-space:pre-line, which risks breaking other aspects of the template.
New line characters are a special case in HTML as they don't really correspond to HTML entities the same way other special characters do. An ability to passive convert values in two brackets placeholders to <br /> is the truest way to handle a situation like this. Even if it's just opt-in, I think it would be extremely useful.
The text was updated successfully, but these errors were encountered:
We are currently only fixing bugs, not adding new features. We need a spec #1277 should be done before adding new features.
Handlebars is not only for HTML so if we where to implement this feature, it should definitely be opt-in. But even then I think it is hard to generalize this feature (html vs xhtml) etc.
I use handlebars with Mpdf, which reads html and converts to pdf.
I have a large set of values, SOME may have newlines in them
\n
, some may not. They currently do not carry through, meaning some values will not have their new lines represented properly.I'm currently stuck with two choices, both are ugly workarounds:
<br />
in advance, and then make ALL the Handlebars placeholders three brackets. This is undesirable as the template will be a pain to read, two brackets is plenty enough to deal withNew line characters are a special case in HTML as they don't really correspond to HTML entities the same way other special characters do. An ability to passive convert values in two brackets placeholders to
<br />
is the truest way to handle a situation like this. Even if it's just opt-in, I think it would be extremely useful.The text was updated successfully, but these errors were encountered: