-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, there was a difference between static and dynamic phrasing content. There was also transparent content, to “inherit” the (static or dynamic) content model from a parent. This was used to prohibit links in links. However, while it is unwise to put links in links, it is possible with markdown to do so, by embedding autolinks in links with resources or references. Take for example: ```markdown [alpha <https://bravo> charlie](delta) ``` Yields, per CommonMark: ```html <p><a href="delta">alpha <a href="https://bravo">https://bravo</a> charlie</a></p> ``` See also: commonmark/commonmark-spec#719. There is also the case where while it is unwise to author such markdown, tools transforming mdast might inject links. It’s probably good to handle such cases in `mdast-util-to-markdown` and such? Not allowing links in links is also something imposed by HTML (particularly the parsing side[^1]): perhaps mdast could be used in places where this restriction doesn’t need to be imposed. Finally, it is hard to type such inherited content models. As in, transparent content is not used in `@types/mdast` (I don’t think it can be typed?): https://github.com/DefinitelyTyped/DefinitelyTyped/blob/3b052a3e5b59b0efaa22669d9bd8f268bd689835/types/mdast/index.d.ts#L286 So, this PR is a proposal to remove the difference and simplify the AST. Closes GH-42. [^1]: You can produce nested `a`s with the DOM: ```js let a1 = document.createElement('a'); a1.textContent = 'alpha'; let a2 = document.createElement('a'); a2.textContent = 'bravo'; a1.appendChild(a2) document.body.appendChild(a1) ```
- Loading branch information
Showing
1 changed file
with
16 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters