\n\n| a |
\n\n\n', 'unmappable-html at /content/0/content/0/content/0: style on spells no value adfToHtml writes there'],
+ ['\n', 'unmappable-html at /content/0/content/0/content/0: | takes colspan, rowspan, data-background-color and data-colwidth first, each once and in that order: found data-background-color out of place'],
[' a b \n', 'unmappable-html at /content/0/content/1: a of the dialect holds data-background-color alone: found "b\\n"'],
['a \n', 'unmappable-html at /content/0: holds straight after it, or a line feed and its first block: found "a \\n"'],
['\n', 'unmappable-html at /content/0: straight after it, or a line feed and its first item: found "a\\n"'],
diff --git a/src/html/text-block-attributes.ts b/src/html/text-block-attributes.ts
index a209f6c..39cfddd 100644
--- a/src/html/text-block-attributes.ts
+++ b/src/html/text-block-attributes.ts
@@ -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
}
|