Comments (8)
thanks for your answer and patience.
from micromark.
This isn't a regression this is to spec
https://spec.commonmark.org/dingus/?text=%3e%20%5b!note%5d%0a%3e%20this%20is%20a%20note.%20who%27d%20have%20noted%3f
from micromark.
This isn't a regression this is to spec
well, depends how you look at it :-)
of course, the transformation of that markdown to HTML (or whatever) can still be according to spec (i.e. just rendering the [!Note]
if the definition is not set).
IMO the parser should not throw away the semantic information of the potential link reference.
this was the behaviour in the previous remark parser: mdast contains the link reference, but remark-stringify renders the plain link text if the definition is not present.
from micromark.
well, depends how you look at it :-)
Every change can be seen as a “regression” if you look at it negatively, but if you look at it positively, it’s a fix. This is documented in the remark changelog: https://github.com/remarkjs/remark/releases. It is the biggest change, and I’ve discussed in with many different folks. I’ve also raised several issues with CommonMark. As this is emphasis: [text *emphasis start][undefined] emphasis end*
, we can’t do what we did before / you want, while supporting CommonMark.
from micromark.
we can’t do what we did before / you want, while supporting CommonMark.
I understand. but the emphasis example is probably an edge case :-), where having a link reference with a non definition not so much.
would it be possible to make it configurable?
from micromark.
It’s the same, because you want it to be a link reference without a definition, and I want it emphasis.
Anyway, it gets way more confusing, see the tests:
micromark/test/io/text/link-reference.mjs
Line 11 in ce4c1dc
Would it be possible to make it configurable?
What’s the benefit of non-standard markdown? Why do you want that? Or this particularly? How would it work in the example I posted before, or with the other cases in the tests?
See also: micromark/common-markup-state-machine#14
from micromark.
What’s the benefit of non-standard markdown?
where in the standard is it defined that link references must have a valid definition?
Why do you want that? Or this particularly?
to ease the transition to the new version :-) i guess the best is to write an extension that detects the [!abc]
links (similar to footnotes)
How would it work in the example I posted before, or with the other cases in the tests?
it wouldn't :-)
from micromark.
where in the standard is it defined that link references must have a valid definition?
The required matching is described here: https://spec.commonmark.org/0.29/#reference-link
to ease the transition to the new version :-)
What is the benefit of a slow tradition instead of ripping the bandaid off and conforming to other markdown parsers?
i guess the best is to write an extension that detects the
[!abc]
links (similar to footnotes)
Yes, that might work!
While extensions are possible my personal opinion is that extensions are bad for the language. It won’t render here on GitHub. It creates lock-in: folks can’t export their “markdown” because it doesn’t render anywhere else. If you really really need to do it, maybe directives are an option. Several projects are going in that direction.
from micromark.
Related Issues (20)
- 3.0.8 seems to introduce a module level dependency on document HOT 9
- `index.d.ts` is missing in `micromark-util-encode` published files HOT 3
- HTML with excess whitespace is not parsed correctly HOT 2
- List items wrapped in <p> tags due to trailing space HOT 3
- hard break at the end of a paragraph is not properly parsed HOT 3
- Make `definitions` available to extensions HOT 2
- Custom extensions break in development mode, despite working in production HOT 6
- & in image url will be encode to html entity HOT 2
- Configure collapsing newlines into a single paragraph HOT 3
- TokenizeContext.sliceSerialize throws in sliceChunks if first chunk of token is Code instead of string HOT 20
- Reduce execution time by ~11% with a simple reimplementation of TokenizeContext.now HOT 3
- nested ordered lists not starting with 1. are not detected HOT 4
- `TokenizeContext.sliceSerialize` for `Token.type` of `setextHeading` includes non-heading content from outside the range of [`startLine`, `endLine`] HOT 1
- `micromark-util-symbol` can not be imported by typescript HOT 9
- Strings ending with `\n-` are compiled into a level 2 heading HOT 3
- Error - [webpack] 'dist': ./node_modules/micromark-util-decode-numeric-character-reference/index.js 23:11 Module parse failed: Identifier directly after number HOT 12
- Emphasis and strong when immediately followed by emphasis in the same word causes extra asterisks to appear HOT 4
- Implementation of autolink and literalAutolink (micromark-extension-gfm-autolink-literal) are inconsistent when handling "@." HOT 10
- Including license in NPM packages HOT 4
- Performance: larger MDX files are unmanagably slow to parse HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micromark.