amagical-net / rails-latex

rails-latex is a renderer for rails which allows tex files with erb to be turned into an inline pdf
MIT License
141 stars 48 forks source link

Escaping special characters like & #22

Closed hammady closed 12 years ago

hammady commented 12 years ago

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?

hammady commented 12 years ago

Ops, I have just figured out the helper lesc!