You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Markdown processors vary in handling of nested emphasis delimiters, but most have some kind of support.
For example, consider the following text:
**a **b** c**
*a *b* c*
Some engines would render the b letters specially because of the nesting, but almost all will recognize that all the asterisk characters in this particular example are in fact delimiters. Basic handling would treat the entire first line as strong emphasis text and the entire second line as emphasis text. That is, the lines will be rendered as:
a b c a b c
I recommend that Mark Text include such support, which it currently lacks, as seen in the below window capture.
Please go ahead and file an issue here. I think the core issue is that both *a ... c* and *b* are valid options but *a *b and b* c* aren't because there are spaces between the delimiter and the character.
If Mark Text uses Marked internally, which I did not know, then I agree that the issue should be passed upstream. However, based on reviewing the issue tracker for Marked, achieving CommonMark compliance is an ongoing activity.
I am reluctant to create or even to mention an issue in Marked, to avoid creating unwanted clutter in their system.
However, since Mark Text is affected, perhaps we can leave open this issue to track progress.
If Mark Text uses Marked internally, which I did not know, then I agree that the issue should be passed upstream.
Yes, we're using a customized fork of marked that is really close to upstream. Please file an issue there because this is a special case and need to be discussed whether and how it should be fixed - both CommonMark and GFM render this a bold/italic.
This is described (not terribly well) in the spec.
Here in Github it's also not bold-italic:
Code
Rendering
*a *b* c*
a b c
**a **b** c**
a b c
The Marked group is working to gain compliance with the standards test suites. Once they do, then the issue would resolve. They already have an issue to track this progress.
Improved support for nested emphasis is now available in marked. PR #2277 attempts to integrate the new version, by changing package.json but is not currently successful. I am not aware of the customized version of marked mentioned earlier.
@brainchild0 We're using a custom version of marked.js and we need to rebase our custom marked.js. The package included in the project is to test our version against the upstream one.
Edit: As our version is behind upstream, we need to rebase all changes from the given commit in the linked readme. I think all bug fixes from marked v0.8.0 are already included in our "fork".
@fxha: It seems that the fork is heavily restructured, into multiple files. I find no obvious way to automate the rebasing from the upstream source.
I have no doubt that you encountered various constraints while writing the fork, but I am wondering about moving to some kind of more automatic and reliable maintenance process. Is it possible to consider including the source in a submodule, and then modifying the library through a static patch applied by a build preprocessor? Or perhaps some of the additional functionality may be gained through monkey patching? Even using simply a forked repository with Git merging may help improve maintenance in the future.
Activity
fxha commentedon Jun 11, 2020
Please go ahead and file an issue here. I think the core issue is that both
*a ... c*and*b*are valid options but*a *bandb* c*aren't because there are spaces between the delimiter and the character.brainchild0 commentedon Jun 12, 2020
If Mark Text uses Marked internally, which I did not know, then I agree that the issue should be passed upstream. However, based on reviewing the issue tracker for Marked, achieving CommonMark compliance is an ongoing activity.
I am reluctant to create or even to mention an issue in Marked, to avoid creating unwanted clutter in their system.
However, since Mark Text is affected, perhaps we can leave open this issue to track progress.
fxha commentedon Jun 16, 2020
Yes, we're using a customized fork of marked that is really close to upstream. Please file an issue there because this is a special case and need to be discussed whether and how it should be fixed - both CommonMark and GFM render this a bold/italic.
See demo.
brainchild0 commentedon Jun 16, 2020
In CommonMark it's double emphasis:
This is described (not terribly well) in the spec.
Here in Github it's also not bold-italic:
*a *b* c***a **b** c**The Marked group is working to gain compliance with the standards test suites. Once they do, then the issue would resolve. They already have an issue to track this progress.
fxha commentedon Jun 16, 2020
Failed GFM examples:
This might be an easy fix because
_foo __bar__ baz_is parsed correctly but_foo _bar_ baz_not.brainchild0 commentedon Jun 17, 2020
Apparently upstream gifts may be coming sooner than expected.
See markedjs/marked#1686.
[-]support nested emphasis delimeters[/-][+]support nested emphasis delimiters[/+]Improve conformance with GFM/CM in handling of delimiters.
Improve conformance with GFM/CM in handling of delimiters
brainchild0 commentedon Jul 14, 2020
Improved support for nested emphasis is now available in marked. PR #2277 attempts to integrate the new version, by changing
package.jsonbut is not currently successful. I am not aware of the customized version of marked mentioned earlier.Improve conformance with GFM/CM in handling of delimiters
fxha commentedon Jul 14, 2020
@brainchild0 We're using a custom version of marked.js and we need to rebase our custom marked.js. The package included in the project is to test our version against the upstream one.
Edit: As our version is behind upstream, we need to rebase all changes from the given commit in the linked readme. I think all bug fixes from marked v0.8.0 are already included in our "fork".
brainchild0 commentedon Jul 15, 2020
@fxha: It seems that the fork is heavily restructured, into multiple files. I find no obvious way to automate the rebasing from the upstream source.
I have no doubt that you encountered various constraints while writing the fork, but I am wondering about moving to some kind of more automatic and reliable maintenance process. Is it possible to consider including the source in a submodule, and then modifying the library through a static patch applied by a build preprocessor? Or perhaps some of the additional functionality may be gained through monkey patching? Even using simply a forked repository with Git merging may help improve maintenance in the future.
fxha commentedon Dec 7, 2020
This seems to be an issue with our frontend and not marked.js.
fix(muya): pair emphasis delimiters the way CommonMark does (#2086) (#…
fix(muya): pair emphasis delimiters the way CommonMark does (marktext…