Precedence between two "text" constructs #80
-
Hello 👋 I maintain the ZMarkdown repository, which has a lot of extensions to remark. I have so far almost managed to get The code for the extension can be found here: https://github.com/zestedesavoir/zmarkdown/tree/next/packages/micromark-extension-kbd , and here is a test, that will not give what I expect it to: *foo||*|| gives <p><em>foo||</em>||</p> but I would want it to give: <p>*foo<kbd>*</kbd></p> As you can see, currently, Thanks a lot 😃 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
hey hey! That conflicts a bit with markdown: *a~b*c~
~a*b~c* Yields: a~bc~
So the earlier one “wins”. But, And then its contents chunks could be linked to form more text? That would be similar to titles (but then using text instead of string as the content type) |
Beta Was this translation helpful? Give feedback.
hey hey!
That conflicts a bit with markdown:
Yields:
a~bc~
a*bc*So the earlier one “wins”.
That’s because emphasis/strong/delete/link/image are parsed separately: as potential starts/ends, and finally when done resolved based on whether they match and which comes first, and the starts/ends that don’t match reverted back to text.
But,
kbd
could perhaps be parsed similarly tocode
/math
? So that it parses from start to end in one go.And then its contents chunks could be linked to form more text? That would be similar to titles (but then using text instead of string as the content type)