开发者

HAML & RoR: Auto-convert apostrophes, etc., to ASCII HTML entities?

开发者 https://www.devze.com 2022-12-08 18:57 出处:网络
Is there anyway to have HAML automatically convert all my apostrophe\'s \' to the HTML character entity equivalents ’ (’)?

Is there anyway to have HAML automatically convert all my apostrophe's ' to the HTML character entity equivalents (’)?

Ditto with all the other characters that one would want to 开发者_开发知识库convert (dashes, double-quotes, etc.) for better online readability.

?


This wouldn't be something HAML would do. If you want it done, write a helper and use gsub to substitute the characters you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号