@@ -139,7 +139,7 @@ describe('syncListMarkerFontFromParagraphRuns', () => {
139139 expect ( block . attrs . wordLayout ?. marker ?. run ?. fontSize ) . toBe ( 40 ) ;
140140 } ) ;
141141
142- it ( 'preserves numbering-defined marker font family but still syncs font size' , ( ) => {
142+ it ( 'preserves numbering-defined marker font family but still syncs font size when size is unset ' , ( ) => {
143143 const block = listBlock ( {
144144 runs : [ { text : 'item' , fontFamily : 'Georgia, serif' , fontSize : 30 } ] ,
145145 markerFamily : 'Symbol' ,
@@ -152,6 +152,75 @@ describe('syncListMarkerFontFromParagraphRuns', () => {
152152 expect ( block . attrs . wordLayout ?. marker ?. run ?. fontSize ) . toBe ( 30 ) ;
153153 } ) ;
154154
155+ it ( 'preserves numbering-defined marker font size from w:sz' , ( ) => {
156+ const sizedSymbolContext = {
157+ ...symbolContext ,
158+ translatedNumbering : {
159+ definitions : { '1' : { numId : 1 , abstractNumId : 1 } } ,
160+ abstracts : {
161+ '1' : {
162+ abstractNumId : 1 ,
163+ levels : {
164+ '0' : {
165+ ilvl : 0 ,
166+ runProperties : {
167+ fontFamily : { ascii : 'Symbol' } ,
168+ fontSize : 20 ,
169+ } ,
170+ } ,
171+ } ,
172+ } ,
173+ } ,
174+ } ,
175+ } ;
176+
177+ const block = listBlock ( {
178+ runs : [ { text : 'item' , fontFamily : 'Georgia, serif' , fontSize : 30 } ] ,
179+ markerFamily : 'Symbol' ,
180+ markerSize : 10 ,
181+ markerText : '•' ,
182+ } ) ;
183+
184+ syncListMarkerFontFromParagraphRuns ( { block, converterContext : sizedSymbolContext as never } ) ;
185+
186+ expect ( block . attrs . wordLayout ?. marker ?. run ?. fontFamily ) . toContain ( 'Symbol' ) ;
187+ expect ( block . attrs . wordLayout ?. marker ?. run ?. fontSize ) . toBe ( 10 ) ;
188+ } ) ;
189+
190+ it ( 'preserves numbering-defined marker font size from w:szCs' , ( ) => {
191+ const sizedSymbolContext = {
192+ ...symbolContext ,
193+ translatedNumbering : {
194+ definitions : { '1' : { numId : 1 , abstractNumId : 1 } } ,
195+ abstracts : {
196+ '1' : {
197+ abstractNumId : 1 ,
198+ levels : {
199+ '0' : {
200+ ilvl : 0 ,
201+ runProperties : {
202+ fontFamily : { ascii : 'Symbol' } ,
203+ fontSizeCs : 20 ,
204+ } ,
205+ } ,
206+ } ,
207+ } ,
208+ } ,
209+ } ,
210+ } ;
211+
212+ const block = listBlock ( {
213+ runs : [ { text : 'item' , fontFamily : 'Georgia, serif' , fontSize : 30 } ] ,
214+ markerFamily : 'Symbol' ,
215+ markerSize : 10 ,
216+ markerText : '•' ,
217+ } ) ;
218+
219+ syncListMarkerFontFromParagraphRuns ( { block, converterContext : sizedSymbolContext as never } ) ;
220+
221+ expect ( block . attrs . wordLayout ?. marker ?. run ?. fontSize ) . toBe ( 10 ) ;
222+ } ) ;
223+
155224 it ( 'reads numbering from block attrs on cache hits so Symbol font is preserved' , ( ) => {
156225 const block = listBlock ( {
157226 runs : [ { text : 'item' , fontFamily : 'Georgia, serif' , fontSize : 40 } ] ,
0 commit comments