Read the emphasis, the links and the lone image CommonMark spells (#34)
CI / gate (push) Successful in 5s

This commit was merged in pull request #34.
This commit is contained in:
2026-08-31 22:33:54 +02:00
parent 0476d33b7b
commit 4ad80e79c5
31 changed files with 899 additions and 218 deletions
+2 -6
View File
@@ -9,9 +9,9 @@ import { inlineDirective } from '../../adf/inline-directives.ts'
import { largestNesting } from '../../nesting.ts'
import { longestBacktickRun } from '../backtick-runs.ts'
import { markSpelling, spellMarkAttributes } from '../mark-spellings.ts'
import { serializeCanonicalJson } from '../../canonical-json.ts'
import { sameMark } from '../../adf/editor-normal.ts'
import { spellAttributes, spellStringAttribute } from '../directive-attributes.ts'
import { spellDestination, spellTitle } from './destination-spelling.ts'
import { spellDestination, spellTitle } from '../link-syntax.ts'
import { spellInlineNodeAttributes } from './inline-directive-spelling.ts'
type EmittedLine = { line: string; segments: InlineSegment[] }
@@ -297,7 +297,3 @@ function emitLink(nodes: readonly AdfNode[], mark: AdfMark, depth: number, range
return success({ segments: [syntax('['), ...inner.value.segments, syntax(`](${destination.value}${spelledTitle.value})`)] })
}
function sameMark(candidate: AdfMark, mark: AdfMark): boolean {
if (candidate.type !== mark.type) return false
return serializeCanonicalJson(candidate.attrs ?? {}, 'compact') === serializeCanonicalJson(mark.attrs ?? {}, 'compact')
}