3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45:44 +01:00

Read every CommonMark image and empty link: an image ADF holds no node for as its linked alt text, a title as its caption, an empty link text as its destination

This commit is contained in:
2026-10-09 03:28:12 +02:00
committed by Lillem4n
parent 847c358358
commit 3b621a9cef
19 changed files with 473 additions and 242 deletions
+158
View File
@@ -0,0 +1,158 @@
{
"content": [
{
"content": [
{
"text": "See ",
"type": "text"
},
{
"marks": [
{
"attrs": {
"href": "https://example.com/moon.png",
"title": "Full"
},
"type": "link"
}
],
"text": "the moon",
"type": "text"
},
{
"text": " tonight, or ",
"type": "text"
},
{
"marks": [
{
"attrs": {
"href": "https://example.com/sun.png"
},
"type": "link"
}
],
"text": "https://example.com/sun.png",
"type": "text"
},
{
"text": ".",
"type": "text"
}
],
"type": "paragraph"
},
{
"attrs": {
"layout": "center"
},
"content": [
{
"attrs": {
"alt": "the moon",
"type": "external",
"url": "https://example.com/moon.png"
},
"type": "media"
},
{
"content": [
{
"text": "The moon, at night.",
"type": "text"
}
],
"type": "caption"
}
],
"type": "mediaSingle"
},
{
"attrs": {
"layout": "center"
},
"content": [
{
"attrs": {
"alt": "the moon",
"type": "external",
"url": "https://example.com/moon.png"
},
"marks": [
{
"attrs": {
"href": "https://example.com/"
},
"type": "link"
}
],
"type": "media"
}
],
"type": "mediaSingle"
},
{
"content": [
{
"text": "Look ",
"type": "text"
},
{
"marks": [
{
"attrs": {
"href": "https://example.com/"
},
"type": "link"
}
],
"text": "here the moon",
"type": "text"
},
{
"text": ", ",
"type": "text"
},
{
"marks": [
{
"attrs": {
"href": "https://example.com/"
},
"type": "link"
}
],
"text": "https://example.com/",
"type": "text"
},
{
"text": " and .",
"type": "text"
}
],
"type": "paragraph"
},
{
"attrs": {
"level": 1
},
"content": [
{
"marks": [
{
"attrs": {
"href": "https://example.com/moon.png"
},
"type": "link"
}
],
"text": "the moon",
"type": "text"
}
],
"type": "heading"
}
],
"type": "doc",
"version": 1
}
+9
View File
@@ -0,0 +1,9 @@
See ![the moon](https://example.com/moon.png "Full") tonight, or ![](https://example.com/sun.png).
![the moon](https://example.com/moon.png "The moon, at night.")
[![the moon](https://example.com/moon.png)](https://example.com/)
Look [here ![the moon](https://example.com/moon.png)](https://example.com/), [](https://example.com/) and []().
# ![the moon](https://example.com/moon.png)