[bug] <small> isnt rendered correctly #591

Open
opened 2023-07-15 20:52:34 +00:00 by remi · 2 comments

Your setup

From source

Extra details

(i dont know, actually. i might be wrong.)

Version

3.9.3-2-gfb8081e1-develop / 91945714+snowdin

PostgreSQL version

No clue

What were you trying to do?

Notes from Misskey(/foundkey/calckey/etc) using the <small> mfm/html tag aren't rendered correctly.

What did you expect to happen?

Text wrapped in a <small> tag should be ... slightly smaller.
image

What actually happened?

Instead, it's completely ignored, and rendered in plain text.
image

It renders "fine" (i.e ignored, but atleast not showing up as plain text) on pleroma, so I'd call this a bug.
image

Logs

N/A

Severity

I cannot use it as easily as I'd like

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Your setup From source ### Extra details (i dont know, actually. i might be wrong.) ### Version 3.9.3-2-gfb8081e1-develop / 91945714+snowdin ### PostgreSQL version No clue ### What were you trying to do? Notes from Misskey(/foundkey/calckey/etc) using the `<small>` mfm/html tag aren't rendered correctly. ### What did you expect to happen? Text wrapped in a `<small>` tag should be ... <small>slightly smaller</small>. ![image](/attachments/88fb043d-7ac9-4d56-bd58-568b31636bdf) ### What actually happened? Instead, it's completely ignored, and rendered in plain text. ![image](/attachments/72b710c7-45f7-4a91-a00d-6c20d8c9ab8c) It renders "fine" (i.e ignored, but atleast not showing up as plain text) on pleroma, so I'd call this a bug. ![image](/attachments/2c8f586b-2554-4266-b176-25d8af5a571d) ### Logs ```shell N/A ``` ### Severity I cannot use it as easily as I'd like ### Have you searched for this issue? - [x] I have double-checked and have not found this issue mentioned anywhere.
remi added the
bug
label 2023-07-15 20:52:34 +00:00
Contributor

Digging into this a little bit more, it might be the fault of the MFM parser (https://akkoma.dev/AkkomaGang/mfm-parser ?) or maybe we should be displaying MFM as HTML anyway. I'll see what mfm.js does

Digging into this a little bit more, it might be the fault of the MFM parser (https://akkoma.dev/AkkomaGang/mfm-parser ?) or maybe we should be displaying MFM as HTML anyway. I'll see what mfm.js does

After some digging I found out that it actually caused by Earmark, it automatically escaped HTML tags if input is not started with an HTML tag.

iex(43)> TestMfm.md("Some text <small>small text</small>", %{breaks: true})
"<p>Some text &lt;small&gt;small text&lt;/small&gt;</p>"
iex(44)> TestMfm.md("<p>Some text <small>small text</small>", %{breaks: true})
<no file>:1: warning: Failed to find closing <p>
"<p>Some text <small>small text</small></p>"
iex(45)> TestMfm.md("<placeholder>Some text <small>small text</small>", %{breaks: true})
<no file>:1: warning: Failed to find closing <placeholder>
"<placeholder>Some text <small>small text</small></placeholder>"

Markdown inside HTML tag is also broken (REF: https://github.com/RobertDober/earmark_parser/issues/119)

After some digging I found out that it actually caused by Earmark, it automatically escaped HTML tags if input is not started with an HTML tag. ```elixir iex(43)> TestMfm.md("Some text <small>small text</small>", %{breaks: true}) "<p>Some text &lt;small&gt;small text&lt;/small&gt;</p>" iex(44)> TestMfm.md("<p>Some text <small>small text</small>", %{breaks: true}) <no file>:1: warning: Failed to find closing <p> "<p>Some text <small>small text</small></p>" iex(45)> TestMfm.md("<placeholder>Some text <small>small text</small>", %{breaks: true}) <no file>:1: warning: Failed to find closing <placeholder> "<placeholder>Some text <small>small text</small></placeholder>" ``` Markdown inside HTML tag is also broken (REF: https://github.com/RobertDober/earmark_parser/issues/119)
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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: AkkomaGang/akkoma#591
No description provided.