All files / roosterjs-content-model-plugins/lib/paste/parsers wordTableParser.ts

100% Statements 6/6
100% Branches 8/8
100% Functions 1/1
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17                1x 13x 6x   13x 5x      
import type { ContentModelTableFormat, FormatParser } from 'roosterjs-content-model-types';
 
/**
 * @internal
 * Parser for processing table formatting specific to Word Desktop
 * @param format The table format to modify
 * @param element The HTML element being processed
 */
export const wordTableParser: FormatParser<ContentModelTableFormat> = (format, element): void => {
    if (format.marginLeft?.startsWith('-')) {
        delete format.marginLeft;
    }
    if (format.htmlAlign) {
        delete format.htmlAlign;
    }
};