diff --git a/src/html/parse/html-to-adf.test.ts b/src/html/parse/html-to-adf.test.ts index 2bf58f6..3ab777c 100644 --- a/src/html/parse/html-to-adf.test.ts +++ b/src/html/parse/html-to-adf.test.ts @@ -185,6 +185,10 @@ const refusals: Readonly> ['

\n', 'unsupported-node-shape at /content/0/content/0 line 1 offset 0'], ['

a

\n', 'unmappable-html at /content/0/content/0 line 1 offset 0'], ], + 'refuses a misspelled attribute value on the line of the character it names': [ + ['\n', 'unmappable-html at /content/0/content/0 line 3 offset 40'], + ['

x

\n', 'unmappable-html at /content/0/content/0 line 2 offset 38'], + ], 'refuses an edit to what a carry element shows': [ [`

a

\n${carry('div', panel, '

Check the collation.

')}\n`, 'unmappable-html at /content/1 line 2 offset 9'], [`

Ask ${carry('span', mention, '')}

\n`, 'unmappable-html at /content/0/content/1 line 1 offset 0'], @@ -284,7 +288,10 @@ const messages: readonly (readonly [string, string])[] = [ ['\n', ' as written here is no inline element of the dialect: found "b\\n\\n"'], ['\n', 'an item\'s line ends at , or at a line feed before the item\'s next block, and its text spells < as <: found "< b\\n\\n"'], ['\n', ' holds its attributes as name="value", each value escaped as text is, then >: found "&b=2\\">x\\n\\n"'], - ['

x

\n', ' as written here is no mark element of the dialect: found "x

\\n"'], + ['
    \n
  • a

    x
  • \n
\n', 'an item\'s line ends at , or at a line feed before the item\'s next block: found "x\\n"…'], + ['
    \n
  • Bolt
      \n
    • a
    • \n
  • \n
\n', 'an item\'s line ends at , or at a line feed before the item\'s next block: found "
    \\n
  • a
  • \\n
x

\n', ' as written here is no mark element of the dialect, and a mark element holds one text, or one mark element holding it: found "x

\\n"'], + ['


x

\n', '
as written here is no mark element of the dialect, and a mark element holds one text, or one mark element holding it: found "
x

\\n"'], ['

x

\n', ' holds its attributes as name="value", each value escaped as text is, then >: found "&b=2\\">x

"…'], [`

a

\n${carry('div', panel, '

Check the collation.

')}\n`, 'a carry element shows its node\'s text as adfToHtml writes it, then ends at ; an edit to it is no edit to the node: found "collation.

', end) && !html.startsWith('\n', end)) { - const stop = misread(html, end, "an item's line ends at , or at a line feed before the item's next block, and its text spells < as <", 'no inline element of the dialect') + const lineEnd = "an item's line ends at , or at a line feed before the item's next block" + // After a line's `

`, or before a block, no inline element can stand. + const stop = line.value.form === 'bare' && !isBlockStart(html, end) ? misread(html, end, `${lineEnd}, and its text spells < as <`, 'no inline element of the dialect') : { at: end, message: `${lineEnd}: ${foundAt(html, end)}` } return refused('unmappable-html', stop.message, html, stop.at, open.place) } const paragraph = asFirstParagraph({ end, node }, line.value.form, html, index, place) diff --git a/src/html/parse/inline.ts b/src/html/parse/inline.ts index 31c65ad..dd15125 100644 --- a/src/html/parse/inline.ts +++ b/src/html/parse/inline.ts @@ -47,7 +47,7 @@ function readMarked(html: string, index: number, place: Place): ReadNode { at = tag.end } if (at === html.length || html.startsWith('<', at)) { - const stop = misread(html, at, 'a mark element holds one text, or one mark element holding it', 'no mark element of the dialect') + const stop = misread(html, at, 'a mark element holds one text, or one mark element holding it', 'no mark element of the dialect, and a mark element holds one text, or one mark element holding it') return refused('unmappable-html', stop.message, html, stop.at, place) } const text = readText(html, at, marks, place)