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

Kill the surviving mutants of the indentation and opened-details reads

This commit is contained in:
2026-11-15 12:05:29 +01:00
committed by Lillem4n
parent ed03d42d8b
commit 0b88649dd8
3 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -30,7 +30,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' && typeof align === 'string') return alignments().has(align) ? ` style="text-align:${alignments().get(align)}"` : undefined
const textAlign = [...alignments()].find(([name]) => name === align)?.[1]
if (mark.type === 'alignment') return textAlign === undefined ? undefined : ` style="text-align:${textAlign}"`
return mark.type === 'indentation' && typeof level === 'number' && indentLevels.includes(String(level)) ? ` ${indentAttribute}="${level}"` : undefined
}