Skip to content
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

Decoding problem in posts preview body for non-lating alphabet languages #694

Open
dagg opened this issue Apr 9, 2024 · 0 comments
Open

Comments

@dagg
Copy link

dagg commented Apr 9, 2024

There is a problem in the left vertical list of the posts titles with the preview of the post body: The post body is not decoded correctly if it's written in a non-latin alphabet (For the Greek language in my case), as it is shown on my screenshot here.

Discussions_Decoding_Problem

The solution I have found and tested is quite simple though.

In the file frontend-app-discussions/src/discussions/posts/post/PostLink.jsx
at the beginning you have to import 'he':

import he from 'he';

and at the following line:

{isPostPreviewAvailable(previewBody) ? previewBody : intl.formatMessage(messages.postWithoutPreview)}

you have to decode the previewBody like so:

{isPostPreviewAvailable(previewBody) ? he.decode(previewBody) : intl.formatMessage(messages.postWithoutPreview)}

And that fixes the problem.

That's my solution but I guess there are other ways to deal with it as well...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant