Keep one merge loop and one mark key: editor-normal compares normalized marks with identicalMark
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { AdfNode } from '../adf/document.ts'
|
||||
import { identicalMarks } from '../adf/document.ts'
|
||||
import { identicalMarks, nodeMarks } from '../adf/document.ts'
|
||||
import { spellInlineLeafDirective } from './directive-syntax.ts'
|
||||
|
||||
export const textBreakName = 'textBreak'
|
||||
@@ -8,7 +8,7 @@ export const textBreakSpelling = spellInlineLeafDirective(textBreakName, '')
|
||||
|
||||
// Whether CommonMark reads the pair back as one text node, where neither rides the carry (spec/flavour.md, Inline nodes).
|
||||
export function readsAsOne(previous: AdfNode, node: AdfNode): boolean {
|
||||
return spelledAsText(previous) && spelledAsText(node) && identicalMarks(previous, node)
|
||||
return spelledAsText(previous) && spelledAsText(node) && identicalMarks(nodeMarks(previous), nodeMarks(node))
|
||||
}
|
||||
|
||||
function spelledAsText(node: AdfNode): boolean {
|
||||
|
||||
Reference in New Issue
Block a user