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

Kill the surviving mutants: spell each element's refusal directly, pin the cell refusals and the 0.3.1 background's anchors

This commit is contained in:
2026-11-15 13:05:14 +01:00
committed by Lillem4n
parent a0f81b12a6
commit f699c2f6a3
3 changed files with 10 additions and 8 deletions
+2 -1
View File
@@ -24,7 +24,8 @@ function markAttribute(mark: AdfMark): string | undefined {
const attrs = nodeAttrs(mark)
if (Object.keys(attrs).length !== 1) return undefined
const { align, level } = attrs
if (mark.type === 'alignment') return typeof align === 'string' && alignments.includes(align) ? ` ${alignAttribute}="${align}"` : undefined
const alignment = alignments.find((name) => name === align)
if (mark.type === 'alignment') return alignment === undefined ? undefined : ` ${alignAttribute}="${alignment}"`
return mark.type === 'indentation' && typeof level === 'number' && indentLevels.includes(String(level)) ? ` ${indentAttribute}="${level}"` : undefined
}