Trim two comments
This commit is contained in:
@@ -77,7 +77,6 @@ export function identicalMarks(left: readonly AdfMark[], right: readonly AdfMark
|
|||||||
return marksKey(left) === marksKey(right)
|
return marksKey(left) === marksKey(right)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Callers say when two nodes join.
|
|
||||||
export function mergeAdjacentText(nodes: readonly AdfNode[], joins: (previous: AdfNode, node: AdfNode) => boolean): AdfNode[] {
|
export function mergeAdjacentText(nodes: readonly AdfNode[], joins: (previous: AdfNode, node: AdfNode) => boolean): AdfNode[] {
|
||||||
const merged: AdfNode[] = []
|
const merged: AdfNode[] = []
|
||||||
for (const node of nodes) {
|
for (const node of nodes) {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export function reduceToPlain(document: AdfDocument): Result<AdfDocument> {
|
|||||||
// docs/decisions.md §Equality is deep: the reduction reads and writes editor-normal ADF.
|
// docs/decisions.md §Equality is deep: the reduction reads and writes editor-normal ADF.
|
||||||
const blocks = reduceBlocks(nodeContent(toEditorNormal(document)), { depth: 0, memo: new Map(), path: [] })
|
const blocks = reduceBlocks(nodeContent(toEditorNormal(document)), { depth: 0, memo: new Map(), path: [] })
|
||||||
if (!blocks.ok) {
|
if (!blocks.ok) {
|
||||||
// Merging text renumbers siblings, so the caller's document names the path of the refusal the editor-normal one meets.
|
// Merging text renumbers siblings, so a refusal's path comes from the caller's document.
|
||||||
const raw = reduceBlocks(nodeContent(document), { depth: 0, memo: new Map(), path: [] })
|
const raw = reduceBlocks(nodeContent(document), { depth: 0, memo: new Map(), path: [] })
|
||||||
return !raw.ok && raw.error.code === blocks.error.code ? raw : blocks
|
return !raw.ok && raw.error.code === blocks.error.code ? raw : blocks
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user