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
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.
ClosesGH-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)
```
0 commit comments