Commit f7df75f
authored
Remove static phrasing content
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)
```1 parent eace3f0 commit f7df75f
1 file changed
+16
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
| |||
527 | 525 | | |
528 | 526 | | |
529 | 527 | | |
530 | | - | |
| 528 | + | |
531 | 529 | | |
532 | 530 | | |
533 | 531 | | |
| |||
536 | 534 | | |
537 | 535 | | |
538 | 536 | | |
539 | | - | |
| 537 | + | |
540 | 538 | | |
541 | 539 | | |
542 | 540 | | |
| |||
568 | 566 | | |
569 | 567 | | |
570 | 568 | | |
571 | | - | |
| 569 | + | |
572 | 570 | | |
573 | 571 | | |
574 | 572 | | |
| |||
577 | 575 | | |
578 | 576 | | |
579 | 577 | | |
580 | | - | |
| 578 | + | |
581 | 579 | | |
582 | 580 | | |
583 | 581 | | |
| |||
674 | 672 | | |
675 | 673 | | |
676 | 674 | | |
677 | | - | |
| 675 | + | |
678 | 676 | | |
679 | 677 | | |
680 | 678 | | |
| |||
684 | 682 | | |
685 | 683 | | |
686 | 684 | | |
687 | | - | |
| 685 | + | |
688 | 686 | | |
689 | 687 | | |
690 | 688 | | |
| |||
747 | 745 | | |
748 | 746 | | |
749 | 747 | | |
750 | | - | |
| 748 | + | |
751 | 749 | | |
752 | 750 | | |
753 | 751 | | |
| |||
758 | 756 | | |
759 | 757 | | |
760 | 758 | | |
761 | | - | |
| 759 | + | |
762 | 760 | | |
763 | 761 | | |
764 | 762 | | |
| |||
961 | 959 | | |
962 | 960 | | |
963 | 961 | | |
964 | | - | |
| 962 | + | |
| 963 | + | |
965 | 964 | | |
966 | 965 | | |
967 | 966 | | |
968 | 967 | | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | 968 | | |
986 | 969 | | |
987 | 970 | | |
| |||
1196 | 1179 | | |
1197 | 1180 | | |
1198 | 1181 | | |
1199 | | - | |
| 1182 | + | |
1200 | 1183 | | |
1201 | 1184 | | |
1202 | 1185 | | |
| |||
1205 | 1188 | | |
1206 | 1189 | | |
1207 | 1190 | | |
1208 | | - | |
| 1191 | + | |
1209 | 1192 | | |
1210 | 1193 | | |
1211 | 1194 | | |
| |||
1269 | 1252 | | |
1270 | 1253 | | |
1271 | 1254 | | |
1272 | | - | |
| 1255 | + | |
1273 | 1256 | | |
1274 | 1257 | | |
1275 | | - | |
1276 | | - | |
| 1258 | + | |
1277 | 1259 | | |
1278 | 1260 | | |
1279 | 1261 | | |
| |||
1365 | 1347 | | |
1366 | 1348 | | |
1367 | 1349 | | |
1368 | | - | |
| 1350 | + | |
1369 | 1351 | | |
1370 | 1352 | | |
1371 | | - | |
| 1353 | + | |
1372 | 1354 | | |
1373 | 1355 | | |
1374 | 1356 | | |
| |||
1671 | 1653 | | |
1672 | 1654 | | |
1673 | 1655 | | |
1674 | | - | |
1675 | | - | |
1676 | | - | |
1677 | | - | |
1678 | 1656 | | |
1679 | 1657 | | |
1680 | 1658 | | |
| |||
0 commit comments