Skip to content

Conversation

@julien-nc
Copy link
Member

refs #26113

Not an ideal solution but it works.
This could be done in many other places.

@julien-nc julien-nc added this to the Nextcloud 22 milestone Mar 22, 2021
@skjnldsv
Copy link
Member

Not an ideal solution but it works.
This could be done in many other places.

What about putting this into @nextcloud/l10n then?

}
},
htmlDecode(s) {
return s.replace(/&#(\d+);/g, (match, code) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have a lib for it?
I would prefer not to have random pieces of code here and there?

https://www.npmjs.com/package/html-entities

"escape-html": "^1.0.3",

html-entities seems a bit big, but we have to see what real size is being added to the webpack bundle?

@julien-nc
Copy link
Member Author

@skjnldsv Do you mean adding and exporting a decode function in @nextcloud/l10n and letting developers use it when they want
or calling it for every result of translate and translatePlural?

@skjnldsv
Copy link
Member

Do you mean adding and exporting a decode function in @nextcloud/l10n and letting developers use it when they want
or calling it for every result of translate and translatePlural?

No I mean fixing the t and n function to automatically htmldecode?

@julien-nc julien-nc closed this Mar 23, 2021
@julien-nc julien-nc deleted the fix/26113/decode-user-name-dashboard-greeting branch March 23, 2021 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants