Decode html characters#244
Conversation
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
5f02000 to
bf1a594
Compare
ChristophWurst
left a comment
There was a problem hiding this comment.
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?