mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-12 11:48:29 +01:00
Answer prose round 1: 0 🔴, 7 🟡 (0 misread); say a card shows its name, else its URL, and tighten the item 133 detail
This commit is contained in:
+2
-4
@@ -442,7 +442,7 @@ it joins the second panel's `<a>` to that portable spelling.
|
||||
Inside a carry element, a card a link marks links to the link's target, and shows its own URL as its
|
||||
text where it has one, so both stay. A card showing only its name keeps its URL in `data-adf` alone.
|
||||
Atlassian's schema gives no card a link mark, so only a hand-built document meets this;
|
||||
`todo.md` item 133 ends it, in 0.3.0, by writing such cards as their own element. Recorded 2026-10-24
|
||||
`todo.md` item 133 settles, in 0.3.0, how such a card is written. Recorded 2026-10-24
|
||||
without a panel of its own: it puts the second panel's `<a>` around the text a card shows.
|
||||
|
||||
A fifth panel (2026-11-04, three readers in the same roles, then four more for what the first three
|
||||
@@ -463,9 +463,7 @@ Seven readers picked a date as
|
||||
and `<span … data-data>` 2. The maintainer took the leading spelling of each, 2026-11-04:
|
||||
|
||||
- a mention is `<span class="adf-mention" data-access-level="CONTAINER" data-id="5b10a2" data-user-type="DEFAULT">@Mikael</span>`, its `text` the content;
|
||||
- a card holding `data` and no URL is `<a class="adf-inline-card" href="https://example.com/plan" data-data="{…}">Release plan</a>`, `href` the URL its `data` holds and the text its name, else that URL. A card holding both `data` and a `url` rides the carry, since read back its `href` would not say which of the two it spells.
|
||||
|
||||
A card a link marks waits on a spelling of its own, `todo.md` item 133, so it rides the carry.
|
||||
- a card holding `data` and no URL is `<a class="adf-inline-card" href="https://example.com/plan" data-data="{…}">Release plan</a>`, `href` the URL its `data` holds and the text its name, else that URL. A card holding both `data` and a `url` rides the carry: its `href`, read back, could not say which of the two URLs it spells.
|
||||
|
||||
## `htmlToAdf` also reads the dialect as a browser serializes it
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { inlineNodeModel } from '../adf/inline-nodes.ts'
|
||||
import { nodeAttrs } from '../adf/document.ts'
|
||||
import { shownText, shownUrl } from '../adf/shown-text.ts'
|
||||
|
||||
// `shown` is the text the element holds and `leading.value` the attribute right after the class, each `undefined` where the node cannot be written as this element and rides the carry. The reader builds the node from the element's `data-*` attributes and text, then holds both to what `shown` and `leading.value` answer for it, so only what the writer writes reads back. `written` names the attributes the text stands in for, which no `data-*` attribute repeats.
|
||||
// `shown` is the text the element holds and `leading.value` the attribute right after the class, each `undefined` where the node cannot be written as this element and rides the carry. The reader builds a node from the element's `data-*` attributes and text, and refuses it unless `shown` and `leading.value` give back that text and attribute, so only what the writer writes reads back. `written` names the attributes no `data-*` attribute may hold, since the text or `leading` spells them.
|
||||
export type NodeElement = {
|
||||
build(data: AdfAttributes, shown: string): AdfAttributes
|
||||
class: string
|
||||
@@ -33,7 +33,7 @@ const nodeElements: Readonly<Record<string, NodeElement>> = {
|
||||
class: 'adf-inline-card',
|
||||
element: 'a',
|
||||
leading: { name: 'href', value: (node) => card(node)?.href },
|
||||
mismatch: 'holds one URL, as its href and as its text, or the name and URL its data-data holds, as its text and its href; to change the card, change them together',
|
||||
mismatch: 'holds one URL, as its href and as its text, or the URL its data-data holds as its href and its name, else that URL, as its text; to change the card, change them together',
|
||||
shown: (node) => card(node)?.text,
|
||||
vocabulary: attributesOf('inlineCard'),
|
||||
written: ['url'],
|
||||
@@ -46,7 +46,7 @@ function attributesOf(type: string): AttributeVocabulary {
|
||||
return inlineNodeModel(type)?.attributes ?? {}
|
||||
}
|
||||
|
||||
// A card holding `data` shows its name and links to the URL `data` holds; one holding both `data` and a `url` rides the carry, since read back its href would not say which of the two it spells.
|
||||
// A card holding both `data` and a `url` rides the carry: its href, read back, could not say which of the two URLs it spells.
|
||||
function card(node: AdfNode): { href: string; text: string } | undefined {
|
||||
const { data, url } = nodeAttrs(node)
|
||||
if (data === undefined) return typeof url === 'string' && url !== '' ? { href: url, text: url } : undefined
|
||||
|
||||
@@ -430,8 +430,8 @@ const messages: readonly (readonly [string, string])[] = [
|
||||
['<ol start="2" start="3">\n<li>a</li>\n</ol>\n', '<ol> takes start once, before its data-* attributes: found start after start'],
|
||||
['<pre data-wrap="yes"><code>x</code></pre>\n', 'data-wrap holds no boolean written as compact JSON'],
|
||||
['<p><span class="adf-emoji"></span></p>\n', '<span class="adf-emoji"> holds its text, which is not empty: found "</span></p>\\n"'],
|
||||
['<p><a class="adf-inline-card" href="https://example.com/">Spec</a></p>\n', '<a class="adf-inline-card"> holds one URL, as its href and as its text, or the name and URL its data-data holds, as its text and its href; to change the card, change them together: found "Spec</a></p>\\n"'],
|
||||
[`<p><a class="adf-inline-card" href="https://example.org/plan" data-data="${planData}">Plan</a></p>\n`, '<a class="adf-inline-card"> holds one URL, as its href and as its text, or the name and URL its data-data holds, as its text and its href; to change the card, change them together: found "Plan</a></p>\\n"'],
|
||||
['<p><a class="adf-inline-card" href="https://example.com/">Spec</a></p>\n', '<a class="adf-inline-card"> holds one URL, as its href and as its text, or the URL its data-data holds as its href and its name, else that URL, as its text; to change the card, change them together: found "Spec</a></p>\\n"'],
|
||||
[`<p><a class="adf-inline-card" href="https://example.org/plan" data-data="${planData}">Plan</a></p>\n`, '<a class="adf-inline-card"> holds one URL, as its href and as its text, or the URL its data-data holds as its href and its name, else that URL, as its text; to change the card, change them together: found "Plan</a></p>\\n"'],
|
||||
['<p><time class="adf-date" datetime="2025-08-26" data-timestamp="1756080000000">x</time></p>\n', '<time class="adf-date"> shows the day its data-timestamp names, in datetime and as its text; to change the date, change all three: found "x</time></p>\\n"'],
|
||||
['<p><span class="adf-emoji" data-size="big">a</span></p>\n', '<span class="adf-emoji"> takes no data-size attribute'],
|
||||
['<p><span class="adf-status">a&b</span></p>\n', 'text escapes & as &, < as < and > as >, and holds no character HTML cannot hold: found "&b</span></p>\\n"'],
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| 133 | 0.3.0 | | question | **Write an inline card a link marks as semantic HTML in `adfToHtml` and read it back in `htmlToAdf`, in place of the carry element.** | 2 | 2 | 2 | 4 | 4 | 6 by 3 | 3.0 |
|
||||
| 133 | 0.3.0 | | question | **Record how `adfToHtml` writes an inline card a link marks in `docs/decisions.md` §The HTML dialect, and make `adfToHtml` and `htmlToAdf` follow it.** | 2 | 2 | 2 | 4 | 4 | 6 by 3 | 3.0 |
|
||||
| 163 | 0.3.0 | | | **Gather a corpus of real-world ADF documents from public Jira and Confluence sites, each recording where it came from and under what licence.** | 3 | 2 | 4 | 7 | 4 | 6 by 3 | 3.0 |
|
||||
| 164 | 0.3.0 | 163 | | **Publish a feature table setting chosen corpus examples beside what each call writes for them, readable at a glance by people and parseable by LLMs, and kept current by the gate.** | 3 | 2 | 1 | 4 | 5 | 3 by 6, 6 by 4 | 6.2 |
|
||||
| 165 | 0.3.0 | 164 | | **Have a reader panel seated from `## Audience` judge each feature-table row reasonable or not, and file an item for each row it rejects.** | 2 | 2 | 1 | 3 | 3 | 6 by 5 | 7.5 |
|
||||
@@ -69,18 +69,13 @@
|
||||
|
||||
## Details
|
||||
|
||||
### 133. Write an inline card a link marks as semantic HTML in `adfToHtml` and read it back in `htmlToAdf`, in place of the carry element.
|
||||
|
||||
Mentions and cards holding `data` are elements since the maintainer took the fifth writer panel's
|
||||
leading spellings (`docs/decisions.md` §The HTML dialect). A card a link marks still rides the carry,
|
||||
which shows the link's target as the link and the card's URL as its text, so both stay in sight.
|
||||
Atlassian's schema gives no card a link mark, so only a hand-built document meets this.
|
||||
### 133. Record how `adfToHtml` writes an inline card a link marks in `docs/decisions.md` §The HTML dialect, and make `adfToHtml` and `htmlToAdf` follow it.
|
||||
|
||||
Class: the HTML dialect's spellings. Earlier entries: a card is `<a class="adf-inline-card" href …>`,
|
||||
and HTML nests no `<a>` in an `<a>`, so the card's element has no room for the link beside it. The
|
||||
nearest candidate keeps the carry: "A card a link marks rides the carry, which keeps both targets in
|
||||
sight; no document Atlassian's editor writes holds one." Its instance is today's output, so the
|
||||
choice is the maintainer's: this item ends with that entry, or with a spelling the maintainer names.
|
||||
and HTML nests no `<a>` in an `<a>`, so the card's element leaves no room for the link. Candidate
|
||||
entry: "A card a link marks rides the carry, which links to the link's target and shows the card's
|
||||
URL where it has one; no document Atlassian's editor writes holds one." Its instance is today's
|
||||
output. The item ends with that entry or with a spelling the maintainer names.
|
||||
|
||||
### 163. Gather a corpus of real-world ADF documents from public Jira and Confluence sites, each recording where it came from and under what licence.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user