diff --git a/src/html/parse/html-to-adf.test.ts b/src/html/parse/html-to-adf.test.ts index 7030c7d..4f4038b 100644 --- a/src/html/parse/html-to-adf.test.ts +++ b/src/html/parse/html-to-adf.test.ts @@ -290,6 +290,8 @@ const messages: readonly (readonly [string, string])[] = [ ['\n', ' holds its attributes as name="value", each value escaped as text is, then >: found "&b=2\\">x\\n\\n"'], ['\n', 'an item\'s line ends at , or at a line feed before the item\'s next block: found "x\\n"…'], ['\n', 'an item\'s line ends at , or at a line feed before the item\'s next block: found "\n
  • a
  • b
  • \n\n', 'an item\'s line ends at , or at a line feed before the item\'s next block: found "
  • b
  • \\n\\n"'], + ['\n', 'an item\'s line ends at , or at a line feed before the item\'s next block: found "
  • b
  • \\n\\n"'], ['

    x

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

    \\n"'], ['


    x

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

    \\n"'], ['

    \n', 'a mark element holds text, or one other mark element around text: found "

    \\n"'], diff --git a/src/html/parse/html-to-adf.ts b/src/html/parse/html-to-adf.ts index 08e02b8..2b891b4 100644 --- a/src/html/parse/html-to-adf.ts +++ b/src/html/parse/html-to-adf.ts @@ -252,8 +252,8 @@ function readItemLine(html: string, index: number, open: Open): Result', end) && !html.startsWith('\n', end)) { 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)}` } + // After a line's `

    `, or before a block or the next item, no inline element can stand. + const stop = line.value.form === 'bare' && !isBlockStart(html, end) && startTagName(html, end) !== 'li' ? 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)