Preventing HTML character entities in locale files from getting munged by Rails3 xss protection

后端 未结 5 1278
遇见更好的自我
遇见更好的自我 2021-02-03 23:58

We\'re building an app, our first using Rails 3, and we\'re having to build I18n in from the outset. Being perfectionists, we want real typography to be used in our views: dashe

5条回答
  •  再見小時候
    2021-02-04 00:29

    I think it isn't a good idea to use use "raw", you could try with yml string like this

    en:
      hello:
        This generates a text paragraph for HTML. " " à @ ' All this text, which you can find in
        these lines, is being concatenated together to one single text node, and then put
        into the body of the 

    ...

    tag. ↂↀऊᎣᏍᏮ⁜℺℻⊛⍟⎬⎨⏏♞♝⚫⚬✱✰✭❺❻➣➱➲⬡⬕

    HTML

    This generates a text paragraph for HTML. " " à @ ' All this text, which you can find in these lines, is being concatenated together to one single text node, and then put into the body of the <p> ... </p> tag. ↂↀऊᎣᏍᏮ⁜℺℻⊛⍟⎬⎨⏏♞♝⚫⚬✱✰✭❺❻➣➱➲⬡⬕
    

    browser view

    This generates a text paragraph for HTML. " " à @ ' All this text, which you can find in these lines, is being concatenated together to one single text node, and then put into the body of the 

    ...

    tag. ↂↀऊᎣᏍᏮ⁜℺℻⊛⍟⎬⎨⏏♞♝⚫⚬✱✰✭❺❻➣➱➲⬡⬕

提交回复
热议问题