3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45:44 +01:00

12c: the block directive forms read and spell !adf: openers and closers

This commit is contained in:
2026-09-16 15:46:52 +02:00
parent 22bbd8c721
commit 0eb2665ffe
83 changed files with 808 additions and 819 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import type { DirectiveSpan, Read } from './directive-syntax.ts'
import { readSoleStringAttribute, spellAttributes, spellLeafDirective, spellStringAttribute, unsupportedNodeShape } from './directive-syntax.ts'
import { readSoleStringAttribute, spellAttributes, spellInlineLeafDirective, spellStringAttribute, unsupportedNodeShape } from './directive-syntax.ts'
const name = 'text'
const whitespaceRun = /^(?:[ \t]+|\n+)$/
@@ -7,7 +7,7 @@ const whitespaceRun = /^(?:[ \t]+|\n+)$/
export const textDirectiveName = name
export function spellTextDirective(text: string): string {
return spellLeafDirective(name, spellAttributes([[name, spellStringAttribute(text)]]))
return spellInlineLeafDirective(name, spellAttributes([[name, spellStringAttribute(text)]]))
}
export function readTextDirective(span: DirectiveSpan): Read<string> | undefined {