@@ -83,10 +83,11 @@ export function handleVRectImport({ rect, pNode }) {
8383 // Extract dimensions for the size attribute
8484 const size = { } ;
8585 if ( parsedStyle . width !== undefined ) {
86- size . width = parsePointsToPixels ( parsedStyle . width ) ;
86+ const inlineWidth = parsePointsToPixels ( parsedStyle . width ) ;
87+ size . width = inlineWidth ;
8788
8889 // Check for full page width identifier and adjust width to be 100%
89- if ( rectAttrs [ 'o:hr' ] === 't' ) {
90+ if ( rectAttrs [ 'o:hr' ] === 't' && ! inlineWidth ) {
9091 size . width = '100%' ;
9192 }
9293 }
@@ -123,6 +124,8 @@ export function handleVRectImport({ rect, pNode }) {
123124 const pPr = pNode . elements ?. find ( ( el ) => el . name === 'w:pPr' ) ;
124125 const spacingElement = pPr ?. elements ?. find ( ( el ) => el . name === 'w:spacing' ) ;
125126 const spacingAttrs = spacingElement ?. attributes || { } ;
127+ const inLineIndentTag = pPr ?. elements ?. find ( ( el ) => el . name === 'w:ind' ) ;
128+ const inLineIndent = inLineIndentTag ?. attributes || { } ;
126129
127130 // Parse spacing using the same logic as paragraphNodeImporter
128131 const spacing = { } ;
@@ -131,6 +134,22 @@ export function handleVRectImport({ rect, pNode }) {
131134 if ( spacingAttrs [ 'w:line' ] ) spacing . line = twipsToLines ( spacingAttrs [ 'w:line' ] ) ;
132135 if ( spacingAttrs [ 'w:lineRule' ] ) spacing . lineRule = spacingAttrs [ 'w:lineRule' ] ;
133136
137+ const indent = {
138+ left : 0 ,
139+ right : 0 ,
140+ firstLine : 0 ,
141+ hanging : 0 ,
142+ } ;
143+ const leftIndent = inLineIndent ?. [ 'w:left' ] ;
144+ const rightIndent = inLineIndent ?. [ 'w:right' ] ;
145+
146+ if ( leftIndent ) {
147+ indent . left = twipsToPixels ( leftIndent ) ;
148+ }
149+ if ( rightIndent ) {
150+ indent . right = twipsToPixels ( rightIndent ) ;
151+ }
152+
134153 return {
135154 type : 'paragraph' ,
136155 content : [
@@ -142,6 +161,7 @@ export function handleVRectImport({ rect, pNode }) {
142161 attrs : {
143162 spacing : Object . keys ( spacing ) . length > 0 ? spacing : undefined ,
144163 rsidRDefault : pNode . attributes ?. [ 'w:rsidRDefault' ] ,
164+ indent,
145165 } ,
146166 } ;
147167}
@@ -261,7 +281,7 @@ export function parsePointsToPixels(value) {
261281 return 0 ;
262282 }
263283 const points = parseFloat ( val ) ;
264- return Math . round ( points * 1.33 ) ;
284+ return Math . ceil ( points * 1.33 ) ;
265285 }
266286
267287 // Handle pixel values
0 commit comments