Reverse the HTML escaping #138

Closed
opened 2018-08-28 18:28:04 +00:00 by lanodan · 8 comments
Owner
  • If you put some <> in your bio it gets translated to &lt; and &gt; which is expected.
  • If there is some & in your bio it gets translated to &amp;.

And pleroma-fe doesn’t reverse html-escape when editing the bio. Which is basically leading to < being a &amp;amp;lt; after few iterations.

- If you put some <> in your bio it gets translated to `&lt;` and `&gt;` which is expected. - If there is some & in your bio it gets translated to `&amp;`. And pleroma-fe doesn’t reverse html-escape when editing the bio. Which is basically leading to `<` being a `&amp;amp;lt;` after few iterations.
Author
Owner

There is also the custom emojos being stripped out of the bio in the next edit.

There is also the custom emojos being stripped out of the bio in the next edit.
Member

Fixed HTML Entity escaping issue in BIO text.
PR: #1794

Will continue with Emoji.

Fixed HTML Entity escaping issue in BIO text. PR: https://git.pleroma.social/pleroma/pleroma-fe/pulls/1794 Will continue with Emoji.
Member

@lanodan Can you please let me know what custom emojis are not working properly?
Even without unescape, Emojis are working fine on my end.

@lanodan Can you please let me know what custom emojis are not working properly? Even without unescape, Emojis are working fine on my end.
Author
Owner

:gentoo: For example.

Content of the bio (via ActivityPub):
$ curl -H 'Accept: application/activity+json' https://queer.hacktivis.me/users/lanodan -s | jq -r .summary
---<br />Website: <a href="https://hacktivis.me/">https://hacktivis.me/</a><br />OpenPGP: DDC9 237C 14CF 6F4D D847 F6B3 90D9 3ACC FEFF 61AE<br />Pronouns: she/fae, elle/iel<br />Lang: en, fr, (LSF), ...<br />```<br />🐺🦄⚧🂡ⓥⒶ☭ 👿🐧 <img height="32px" width="32px" alt="gentoo" title="gentoo" src="https://queer.hacktivis.me/emoji/custom/gentoo.png" /><br />Pleroma dev (backend, mastofe)<br /><br />banner from: <a href="https://soc.flyingcube.tech/objects/56f79be2-9013-4559-9826-f7dc392417db">https://soc.flyingcube.tech/objects/56f79be2-9013-4559-9826-f7dc392417db</a><br />Federation-bots: <a class="hashtag" data-tag="nobot" href="https://queer.hacktivis.me/tag/nobot">#nobot</a>

What I get when going to /user-settings:
---Website: https://hacktivis.me/OpenPGP: DDC9 237C 14CF 6F4D D847 F6B3 90D9 3ACC FEFF 61AEPronouns: she/fae, elle/ielLang: en, fr, (LSF), ...```🐺🦄⚧🂡ⓥⒶ☭👿🐧 Pleroma dev (backend, mastofe)banner from: https://soc.flyingcube.tech/objects/56f79be2-9013-4559-9826-f7dc392417dbFederation-bots: #nobot

`:gentoo:` For example. Content of the bio (via ActivityPub): ``$ curl -H 'Accept: application/activity+json' https://queer.hacktivis.me/users/lanodan -s | jq -r .summary`` ``---<br />Website: <a href="https://hacktivis.me/">https://hacktivis.me/</a><br />OpenPGP: DDC9 237C 14CF 6F4D D847 F6B3 90D9 3ACC FEFF 61AE<br />Pronouns: she/fae, elle/iel<br />Lang: en, fr, (LSF), ...<br />```<br />🐺🦄⚧🂡ⓥⒶ☭ 👿🐧 <img height="32px" width="32px" alt="gentoo" title="gentoo" src="https://queer.hacktivis.me/emoji/custom/gentoo.png" /><br />Pleroma dev (backend, mastofe)<br /><br />banner from: <a href="https://soc.flyingcube.tech/objects/56f79be2-9013-4559-9826-f7dc392417db">https://soc.flyingcube.tech/objects/56f79be2-9013-4559-9826-f7dc392417db</a><br />Federation-bots: <a class="hashtag" data-tag="nobot" href="https://queer.hacktivis.me/tag/nobot">#nobot</a>`` What I get when going to `/user-settings`: ``---Website: https://hacktivis.me/OpenPGP: DDC9 237C 14CF 6F4D D847 F6B3 90D9 3ACC FEFF 61AEPronouns: she/fae, elle/ielLang: en, fr, (LSF), ...```🐺🦄⚧🂡ⓥⒶ☭👿🐧 Pleroma dev (backend, mastofe)banner from: https://soc.flyingcube.tech/objects/56f79be2-9013-4559-9826-f7dc392417dbFederation-bots: #nobot``
Owner

I'm confused about what has been done #1794 and what is actually wanted here. @lanodan is the intended behavior that frontend displays the bio as html without doing any escaping? So remove any escaping at all basically (both in display and edit)?

I'm confused about what has been done #1794 and what is actually wanted here. @lanodan is the intended behavior that frontend displays the bio as html without doing any escaping? So remove any escaping at all basically (both in display and edit)?
Member

@shpuld before #1794, in the bio, html entities was not unescapedScreen_Shot_2019-02-05_at_9.30.17_AM

@shpuld before #1794, in the bio, html entities was not unescaped![Screen_Shot_2019-02-05_at_9.30.17_AM](/attachments/f9cee0e6-9617-4c06-a1dd-f6aa83bf53f3)
Owner

ah clear, carry on

ah clear, carry on

Tried these out right now, everything works as expected.

Tried these out right now, everything works as expected.
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma-fe#138
No description provided.