This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.5k
ngPluralize: support for HTML tags in translations? #4790
Milestone
Comments
+1 |
ghost
assigned tbosch
Jan 11, 2014
+1 |
7 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
👍 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
+1. In the mean time I've created a gist that I'm using in place of ngPluralize where I need HTML |
+1 |
1 similar comment
👍 |
+1 |
1 similar comment
+1 |
Using html with pluralize should be strait-forward with a small ad-hoc directive as it is the case here |
+1 |
2 similar comments
+1 |
+1 |
Hi, this seems a little bit late, but in case anyone still has some problem with this one, I created directives that can solve this problem. It can be found here https://github.com/christianesperar/ng-pluralize-html You can see it in action here https://rawgit.com/christianesperar/ng-pluralize-html/master/example/github.html |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I found myself in a situation where some of the translation, and not all, must be within a strong tag. Since the ngPluralize directive uses
element.text()
(source) then the string is HTML escaped, and it doesn't work.Since it may lead to XSS issues, I was wondering how to allow ngPluralize to use
element.html()
in some cases. If $interpolate already escapes the interpolated values, then maybe the directive could useelement.html()
? Or may be add an attribute likeas="html"
to give the user control over the HTML safeness of the translation? All it would need then is:The text was updated successfully, but these errors were encountered: