All files / roosterjs-content-model-markdown/lib/constants headings.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/3

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 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35    1x                       1x                       1x                
type HeadingLevelTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
 
const HeaderFontSizes: Record<HeadingLevelTags, string> = {
    h1: '2em',
    h2: '1.5em',
    h3: '1.17em',
    h4: '1em',
    h5: '0.83em',
    h6: '0.67em',
};
 
/**
 * @internal
 */
export const headingLevels = [
    { prefix: '# ', tagName: 'h1', fontSize: HeaderFontSizes.h1 },
    { prefix: '## ', tagName: 'h2', fontSize: HeaderFontSizes.h2 },
    { prefix: '### ', tagName: 'h3', fontSize: HeaderFontSizes.h3 },
    { prefix: '#### ', tagName: 'h4', fontSize: HeaderFontSizes.h4 },
    { prefix: '##### ', tagName: 'h5', fontSize: HeaderFontSizes.h5 },
    { prefix: '###### ', tagName: 'h6', fontSize: HeaderFontSizes.h6 },
];
 
/**
 * @internal
 */
export const MarkdownHeadings: Record<string, string> = {
    h1: '# ',
    h2: '## ',
    h3: '### ',
    h4: '#### ',
    h5: '##### ',
    h6: '###### ',
};