File tree Expand file tree Collapse file tree
packages/super-editor/src/editors/v1/document-api-adapters/plan-engine Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,14 +67,17 @@ function extractTextPreview(node: ProseMirrorNode): string | null {
6767
6868const HEADING_PATTERN = / ^ H e a d i n g ( \d ) $ / ;
6969
70+ /** OOXML implicit default font size when neither Normal style nor docDefaults specifies one. */
71+ const OOXML_DEFAULT_FONT_SIZE_PT = 10 ;
72+
7073/**
7174 * Resolve the document's default font size (in points) from the style catalog.
72- * Falls back through: Normal style rPr → docDefaults rPr → undefined .
75+ * Falls back through: Normal style rPr → docDefaults rPr → OOXML implicit default (10pt) .
7376 * OOXML stores fontSize as half-points (w:sz val), so we divide by 2.
7477 */
75- function resolveDefaultFontSizePt ( editor : Editor ) : number | undefined {
78+ function resolveDefaultFontSizePt ( editor : Editor ) : number {
7679 const styleProps = readTranslatedLinkedStyles ( editor ) ;
77- if ( ! styleProps ) return undefined ;
80+ if ( ! styleProps ) return OOXML_DEFAULT_FONT_SIZE_PT ;
7881
7982 // Try Normal style first
8083 const normalStyle = styleProps . styles ?. [ 'Normal' ] ;
@@ -85,7 +88,7 @@ function resolveDefaultFontSizePt(editor: Editor): number | undefined {
8588 const defaultFontSize = styleProps . docDefaults ?. runProperties ?. fontSize ;
8689 if ( typeof defaultFontSize === 'number' ) return defaultFontSize / 2 ;
8790
88- return undefined ;
91+ return OOXML_DEFAULT_FONT_SIZE_PT ;
8992}
9093
9194/**
You can’t perform that action at this time.
0 commit comments