10a - three comments restating their function go
CI / gate (push) Successful in 35s
CI / publish (push) Successful in 6s

This commit was merged in pull request #128.
This commit is contained in:
2026-09-25 19:40:27 +02:00
parent 0094b361ab
commit 687ba9bf90
-3
View File
@@ -98,7 +98,6 @@ export function oneLine(text: string): string {
return text.replace(/[\r\u0000]/g, '').replace(/\n/g, ' ') return text.replace(/[\r\u0000]/g, '').replace(/\n/g, ' ')
} }
// Blank once a text leaf's cleaning has run is empty.
function nonEmpty(value: unknown): string | undefined { function nonEmpty(value: unknown): string | undefined {
return typeof value === 'string' && oneLine(value).trim() !== '' ? value : undefined return typeof value === 'string' && oneLine(value).trim() !== '' ? value : undefined
} }
@@ -115,7 +114,6 @@ function lineBreak(container: LineContainer): AdfNode {
return container === 'paragraph' ? { type: 'hardBreak' } : textLeaf(' ', []) return container === 'paragraph' ? { type: 'hardBreak' } : textLeaf(' ', [])
} }
// note: what the content is named in the note left where it has none.
function textLeaves(value: unknown, marks: readonly AdfMark[], container: LineContainer, note?: string): AdfNode[] { function textLeaves(value: unknown, marks: readonly AdfMark[], container: LineContainer, note?: string): AdfNode[] {
if (typeof value !== 'string') return note === undefined ? [] : noteLeaves(note) if (typeof value !== 'string') return note === undefined ? [] : noteLeaves(note)
const text = value.replace(/[\r\u0000]/g, '') const text = value.replace(/[\r\u0000]/g, '')
@@ -235,7 +233,6 @@ function leafEdges(leaf: AdfNode, previous: AdfNode | undefined, next: AdfNode |
return edges return edges
} }
// The marks the whitespace keeps, or undefined where it goes.
function edgeDepth(marks: readonly AdfMark[], neighbour: AdfNode | undefined, whitespace: string): number | undefined { function edgeDepth(marks: readonly AdfMark[], neighbour: AdfNode | undefined, whitespace: string): number | undefined {
if (whitespace === '') return marks.length if (whitespace === '') return marks.length
const lineEdge = neighbour === undefined || neighbour.type === 'hardBreak' const lineEdge = neighbour === undefined || neighbour.type === 'hardBreak'