Open deathaxe opened 3 years ago
This is essentially the same issue as https://github.com/sublimehq/Packages/issues/1499, which we can potentially resolve with branching now.
Why? Markup should be disabled between html tags, shouldn't it? So none of those chars -
, *
, ~
should have any special meaning then. Just pushing a context onto stack once <kbd>
is matched, expecting it to be closed by </kbd>
should do the trick.
Why? Markup should be disabled between html tags, shouldn't it?
Only block level tags which start the line iirc. We have a test assertion to prove bold and italic work even through closing tags, which is how GFM and CommonMark also treat it - as valid.
That's not exactly what I see, when calling MarkdownPreview > Github
I don't understand what you mean
<kbd>~~I don't understand what you mean~~</kbd>
Inline markup is valid inside inline HTML tags. What we shoul do is prevent ~
from being able to capture across tag boundaries, because HTML is strictly hierarchical, but in order to do that properly we need branching. We definitely should, however.
__test <span>text__ *formatted</span>test*
*test <span>text* __formatted</span>test__
Up to this point I was confident Markdon to be something reasonable structured peace of standard - seems I have been wrong.
Hmm. Formatting stops at closing tags, but is applied only if closing ~~
exists. What a mess.
spec.commonmark.org/dingus/?text=test%20%3Cspan%3Etext%20formatted%3C%2Fspan%3Etest%0A%0Atest%20%3Cspan%3Etext%20formatted%3C%2Fspan%3Etest%0A
I am legitimately surprised that these work. They even produce the HTML you would expect.
It even makes sense if you consider that li
tags also don't need to be closed, so what happens above is that the span tag is closed implicitly by </strong>
and the following </span>
does nothing.
Also explains @deathaxe's examples.
Now, watch me make things even more confusing in GFM, where the kbd tag just resets inline markdown (unlike with the span tag).
test text normal formattedtest
test text normal formattedtest
test text normal formattedtest
test text normal formattedtest
__test <span>text__ normal *formatted</span>test*
__test <kbd>text__ normal *formatted</kbd>test*
~~test <span>text~~ normal ~~formatted</span>test~~
~~test <kbd>text~~ normal ~~formatted</kbd>test~~
Code
GitHub rendering result
~~
(strikethrough). When you for instance select the word "foo" and hit~
, the result will be~~foo~~
.Sublime Text highlighting
The whole paragraph after
<kbd>~</kbd>
is scopedmarkup.strikethrough