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

Avoid treating simple messages as Markdown #325

Merged
merged 1 commit into from
Aug 17, 2024
Merged

Conversation

ulyssa
Copy link
Owner

@ulyssa ulyssa commented Aug 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. )

@ulyssa ulyssa added this to the v0.0.10 milestone Aug 17, 2024
@ulyssa ulyssa merged commit e63341f into main Aug 17, 2024
4 checks passed
@ulyssa ulyssa deleted the markdown-convert-skip branch August 17, 2024 06:56
@ulyssa ulyssa mentioned this pull request Aug 21, 2024
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

Successfully merging this pull request may close these issues.

1 participant