Avoid treating simple messages as Markdown #214

Closed
opened 2025-10-14 15:42:51 -06:00 by navan · 0 comments
Owner

Originally created by @ulyssa on 8/17/2024

This is a first stab at improving the issue reported in #306 by not generating a formatted_body unless the text actually contains Markdown. I've done this for now based on characters used, which largely ends up meaning "doesn't contain ASCII punctuation" except for single and double quotes which are okay.

There's still some room for improvement in a future PR: Element will generate a formatted_body without surrounding <p> tags as long as everything fits on one line. While the <p> tags should be harmless, it seems like some clients will show them with trailing space in the timeline, which makes messages sent from iamb take up additional space. (This seems to be most egregious in Element Android. Element Web, Element iOS and FluffyChat don't seem to add any extra space that I notice compared to the Element Android screenshot shared in #iamb-users:0x.badd.cafe. )

*Originally created by @ulyssa on 8/17/2024* This is a first stab at improving the issue reported in #306 by not generating a `formatted_body` unless the text actually contains Markdown. I've done this for now based on characters used, which largely ends up meaning "doesn't contain ASCII punctuation" except for single and double quotes which are okay. There's still some room for improvement in a future PR: Element will generate a `formatted_body` without surrounding `<p>` tags as long as everything fits on one line. While the `<p>` tags should be harmless, it seems like some clients will show them with trailing space in the timeline, which makes messages sent from iamb take up additional space. (This seems to be most egregious in Element Android. Element Web, Element iOS and FluffyChat don't seem to add any extra space that I notice compared to the Element Android screenshot shared in `#iamb-users:0x.badd.cafe`. )
navan closed this issue 2025-10-14 15:42:52 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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: github/iamb#214
No description provided.