3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-18 22:25:44 +01:00

Answer architecture round 1: the node table says a hard break takes no marks, and a link text of hard breaks alone reads as its destination

This commit is contained in:
2026-10-09 11:04:30 +02:00
committed by Lillem4n
parent 32bee5ab91
commit 2ca5ac41e6
16 changed files with 185 additions and 34 deletions
+8 -6
View File
@@ -2,14 +2,15 @@ import type { AttributeVocabulary } from './attribute-vocabulary.ts'
export type InlineNodeModel = {
attributes: AttributeVocabulary
marks: boolean
textAttribute?: string
}
export const inlineNodes: Readonly<Record<string, InlineNodeModel>> = {
date: { attributes: { localId: 'string', timestamp: 'string' } },
emoji: { attributes: { id: 'string', localId: 'string', shortName: 'string', text: 'string' }, textAttribute: 'text' },
hardBreak: { attributes: { localId: 'string', text: 'string' } },
inlineCard: { attributes: { data: 'json', localId: 'string', url: 'string' } },
date: { attributes: { localId: 'string', timestamp: 'string' }, marks: true },
emoji: { attributes: { id: 'string', localId: 'string', shortName: 'string', text: 'string' }, marks: true, textAttribute: 'text' },
hardBreak: { attributes: { localId: 'string', text: 'string' }, marks: false },
inlineCard: { attributes: { data: 'json', localId: 'string', url: 'string' }, marks: true },
mediaInline: {
attributes: {
alt: 'string',
@@ -22,9 +23,10 @@ export const inlineNodes: Readonly<Record<string, InlineNodeModel>> = {
type: 'string',
width: 'number',
},
marks: true,
},
mention: { attributes: { accessLevel: 'string', id: 'string', localId: 'string', text: 'string', userType: 'string' }, textAttribute: 'text' },
status: { attributes: { color: 'string', localId: 'string', style: 'string', text: 'string' }, textAttribute: 'text' },
mention: { attributes: { accessLevel: 'string', id: 'string', localId: 'string', text: 'string', userType: 'string' }, marks: true, textAttribute: 'text' },
status: { attributes: { color: 'string', localId: 'string', style: 'string', text: 'string' }, marks: true, textAttribute: 'text' },
}
export function inlineNodeModel(type: string): InlineNodeModel | undefined {