Escaping special characters like &
hammady opened this issue · comments
Hossam Hammady commented
If a string to be rendered in erb contains & it generates a pdflatex error.
For example:
<%= @title %>
where @title contains &, gives an error.
Should escape special characters with .
If you do this manually, the & is converted to & due to html escaping.
A manual fix is to write @title.html_safe but that's not handy if you have a lot of strings.
Is there a way to fix these automatically?
Hossam Hammady commented
Ops, I have just figured out the helper lesc!