angularjs-localizationservice icon indicating copy to clipboard operation
angularjs-localizationservice copied to clipboard

HTML in JSON not rendered

Open frontshift opened this issue 11 years ago • 1 comments

First of all thanks for this awesome module. I really like the idea of using directives instead of filters to increase performance....

Currently it's not possible to have HTML as part of the localised copy because the content is being set as text on the element.

It would be really handy to have this functionality to force line breaks etc. e.g.:

   {
        "key": "component.title",
        "value": "my title and this</br>goes onto the second line",
        "description": ""
    }

The fix is as simple as using element.html() instead of element.text() when setting source values...

Do you see any issues with that?

frontshift avatar Apr 03 '14 09:04 frontshift

The biggest issue would be security, but if we put in a dependency for ngSanitize we can make sure that only safe HTML is only ever displayed. I'll be working on this module soon so I will take a look at allowing HTML to be returned as part of the directives.

Thanks for the suggestion.

lavinjj avatar Apr 03 '14 13:04 lavinjj