-
Notifications
You must be signed in to change notification settings - Fork 4
Decode html characters #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Julien Veyssier <[email protected]>
5f02000 to
bf1a594
Compare
ChristophWurst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like a bad idea. you can achieve the same with options.sanitize=false
|
@ChristophWurst Thanks, that's what I was looking for. Do you mean on some I tried it but I'm still getting the HTML char codes for placeholders substitutions. t('app', 'Hello {name}', { name: 'O\'Brian' }, {}, null, { sanitize: false })returns |
There is also |
t('app', 'Hello {name}', { name: 'O\'Brian' }, {}, null, { sanitize: false, escape: false })still returns |
Make sure you're properly using the method from |
|
Any update here? |
|
@skjnldsv @ChristophWurst Using import { translate } from '@nextcloud/l10n'
console.debug(translate('app', 'Hello {name}', { name: 'O\'Brian' }, {}, null, { sanitize: false, escape: false }))
// => Hello O'Brian
console.debug(window.t('app', 'Hello {name}', { name: 'O\'Brian' }, {}, null, { sanitize: false, escape: false }))
// => Hello O'Brian |
|
Sorry for the noise. There are too many parameters passed in the examples I gave. All good. |
|
@eneiluj will nextcloud/server#26113 not be fixed then? |
|
@szaimen Yes, thanks for reminding me: nextcloud/server#27912 |
When a placeholder contains characters like
' " < >, they are replaced by their HTML code. This leads to this kind of issues:Fix nextcloud/server#26113
Would it be a good solution to decode them here?