-
Notifications
You must be signed in to change notification settings - Fork 2
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
Emphasis (italics), strong (bold), also links and images #4
Comments
I really like this feature. It gives markdown editing a bit of a WYSIWYG experience. I recognize the limitations you mentioned from both the current markdown highlighting experience in both VSCode and Discord. However, if such popular tools have this issue already, maybe most people don’t find it such a big deal. Also my Monarch language from microsoft/monaco-editor#3096 supports multiline emphasis/strong text, but it does have other limitations. Maybe there’s something in there you can use for inspiration, but probably not. |
I use markdown (and MDX) in my educational material and people often read it in their editor. So having inline highlights for stuff like this is actually rather important for them to see the emphasis visually in their editor. But I understand if that's not reason enough. |
I want to stress that things are highlighted. Those asterisks or underscores are marked.
That may not be a good thing, markdown is also in my opinion about meaning, not just about how it looks with bold and italics.
I wonder. Because with the new MDX highlighting, I got responses that people didn’t know blank lines could be used in ESM. Similarly, I assume that people didn’t know they can indent MDX. And several other things that work fine in the language, but just weren’t highlighted.
That’s great but it isn’t possible in TextMate languages. They work per line. Or there is no backtracking. Two choices: a) either you don’t mark |
Honest question, why highlight headings then? |
Because they can be highlighted, properly, according to CommonMark. No trade offs. There are limitations at play for emphasis/strong/links/images. In how markdown must be parsed and how highlighting works. Which means you can’t get them correct. So, there are trade offs.
I think that’s more in line with what syntax highlighting is for: it doesn’t bring guarantees that your code will run. It’s not a linter. It’s also supposed to do things while you are typing. |
Several programming languages support multiline strings, including nested syntax for variables. Is this somehow different from highlighting markdown emphasis / strong? JavaScript uses a single backtick as delimiter, more similar to markdown emphasis: export const string = `
multiline
string
${withVariables}
` Python uses triple quotes ( string = f"""
multiline
fstring
{withVariables}
""" |
And what happens in those languages/grammars when you don’t do the final |
People who run into this issue may be interested in the |
Originally reported by @kentcdodds at #1
Emphasis and strong in markdown are typically rendered bold, italic. This grammar does not do that. I thought I’d open this issue to allow a discussion around it, and to explain why.
This is a “feature not a bug” kinda thing. But it’s important and different. So I’m very open to discussing it.
This different handling is inspired by how other markup languages work.
In HTML or JSX, when you write
<strong>whatever</strong>
, or<a href="#">whatever</a>
, things do not become bold or underlined either.You can also write
asd <strong>asd
in them and have that be marked, which I think is nice.Making things actually bold, actually italic, is somewhat nice and useful. But:
asd **asd
from above), which is important in editors.[
,]
,*
, and_
together is so complex that it can’t be put into a regexWhich is why this syntax is more like other markup languages and doesn’t show bold or italics.
The text was updated successfully, but these errors were encountered: