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

[SuperEditorMarkdown] Attributions not placed according to markdown standard when serializing document (#2424) #2452

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

edhom
Copy link

@edhom edhom commented Dec 10, 2024

Hi @matthew-carroll, hi @angelosilvestre :) Here's a PR with failing tests following up on your comment here. I also added some background below to motivate why I think this is an issue. Thanks again for your support here and I hope I can contribute myself after some guidance!

Background

The AttributedTextMarkdownSerializer places markdown formatting symbols according to the offset of attribution markers. This results in invalid markdown, as the markdown standard doesn't allow leading/trailing whitespaces. The closest official source I find to back my issue of incorrect markdown annoations is the following:

To bold/italicize text, add one/two asterisks before and after a word or phrase. (markdownguide.org)

Also from the examples in the original spec from John Gruber, it's obvious that the annotation should be around a word/phrase and not white space.

GitHub shows ** bold text** and not bold text just as flutter_markdown.

@matthew-carroll
Copy link
Contributor

Also from the original spec from John Gruber, it's obvious that the annotation should be around a word/phrase and not white space.

Why is this "obvious"? What specifically are you referring to in the original spec? Neither of your links seem to mention or address the question of spaces at all.

@edhom
Copy link
Author

edhom commented Dec 11, 2024

@matthew-carroll Sorry I wanted to refer to the examples, they consistently show the delimiters placed directly around the text without spaces. And you're right it's not obvious at all that it shouldn't be allowed to have whitespaces. But that's what most markdown renderers implemented.

@matthew-carroll
Copy link
Contributor

Can you show a few examples of editors that behave the way you're describing here? Namely, editors that aren't using Flutter - editors that have a longer track record and user base.

@edhom
Copy link
Author

edhom commented Dec 12, 2024

Sure!

Editor Preview
VSCode, built-in markdown preview Screenshot 2024-12-12 at 07 50 28
Typora Screenshot 2024-12-12 at 07 57 22
StackEdit Screenshot 2024-12-12 at 08 01 00
Dillinger Screenshot 2024-12-12 at 08 06 05
GitHub ** bold text **, bold text

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.

2 participants