mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-19 14:45:44 +01:00
Answer principles round 4: 0 🔴, 1 🟡 (0 misread); an item's line names the missing </li> before the next item too
This commit is contained in:
@@ -252,8 +252,8 @@ function readItemLine(html: string, index: number, open: Open): Result<BlockStep
|
||||
const { end, node } = line.value
|
||||
if (!html.startsWith('</li>', end) && !html.startsWith('\n', end)) {
|
||||
const lineEnd = "an item's line ends at </li>, or at a line feed before the item's next block"
|
||||
// After a line's `</p>`, 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 `</p>`, 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)
|
||||
|
||||
Reference in New Issue
Block a user