We're using Bluecloth for the text formatting on a rails website but I've run into a problem with some email addresses. When they have double underscores in the address BlueCloth is translating it into EM tags.
In the rails console:
BlueCloth::new("[email protected]").to_html
"<p>[email protected]</p>"
An email address with a single underscore works fine, but when there are two underscores in the address the underscores are changed to em tags:
BlueCloth::new("[email protected]").to_html
"<p>bob<em>jones</em>[email protected]</p>"
I need the formatting for the rest of the text but I need away to turn it off for the email addresses. I feel like I used to be able to use a notextile tag but that doesn't seem to work anymore.
BlueCloth::new("<notextile> [email protected] </notextile>").to_html
"<p><notextile> bob<em>jones</em>[email protected] </notextile></p>"
Anyone know how to deal with this? We're using bluecloth version 2.2.0.
One option is to switch the
:relaxed
setting totrue
:The option documentation is available online but the option names and the way they map to the options in the underlying C library is not always obvious.
If you want to use the default options for text where you need in-word emphasis in some places but not others you can explicitly escape the underscores: