Fix the false claims round one found, and refuse the content a code span dropped
CI / gate (push) Successful in 5s
CI / gate (push) Successful in 5s
This commit is contained in:
@@ -48,7 +48,7 @@ export function tryImageLine(alt: string | undefined, href: string, path: Conver
|
||||
return attempt.ok ? attempt.value.line : undefined
|
||||
}
|
||||
|
||||
// A demand names a run no spelling holds, and a carried node joins no run, so every pass carries one more node.
|
||||
// A demand names a run no spelling holds, and a carried node joins no run, so every pass carries at least one more node.
|
||||
function emitLine(nodes: readonly AdfNode[], container: LineContainer, path: ConvertErrorPath): Result<EmittedLine> {
|
||||
const carried = new Set<number>()
|
||||
for (;;) {
|
||||
@@ -262,6 +262,7 @@ function emitCodeSpan(nodes: readonly AdfNode[], depth: number, range: NodeRange
|
||||
for (const node of nodes) {
|
||||
if (node.type !== 'text' || (node.marks ?? []).length !== depth + 1) return success({ carry: range })
|
||||
if (typeof node.text !== 'string' || node.text === '') return failure('unsupported-node-shape', 'a text node holds text', path)
|
||||
if ((node.content ?? []).length > 0) return failure('unsupported-node-shape', 'a text node holds no content', path)
|
||||
text += node.text
|
||||
}
|
||||
if (/[\n\r]/.test(text)) return success({ carry: range })
|
||||
|
||||
Reference in New Issue
Block a user