@@ -451,6 +451,7 @@ internal static DocxDocument Read(Stream stream)
451451 bool snapToGrid = true ;
452452 int listLevel = 0 ;
453453 string ? listText = null ;
454+ bool listTextBold = false ;
454455 string ? styleId = null ;
455456 bool bold = false ;
456457 bool italic = false ;
@@ -562,6 +563,7 @@ internal static DocxDocument Read(Stream stream)
562563 var lvlDef = numDef . Levels . FirstOrDefault ( l => l . Ilvl == listLevel ) ?? numDef . Levels . FirstOrDefault ( ) ;
563564 if ( lvlDef != null )
564565 {
566+ if ( lvlDef . Bold ) listTextBold = true ;
565567 if ( indentLeft == 0 && lvlDef . IndentLeft > 0 )
566568 indentLeft = lvlDef . IndentLeft ;
567569 if ( indentFirstLine == 0 && lvlDef . Hanging > 0 )
@@ -855,7 +857,7 @@ internal static DocxDocument Read(Stream stream)
855857 // If paragraph has no runs and no images, represent as empty paragraph for spacing
856858 return new DocxParagraph ( runs , images , alignment , spacingBefore , spacingAfter ,
857859 lineSpacing , lineSpacingAbsolute , lineSpacingExact , indentLeft , indentRight , indentFirstLine ,
858- isBulletList , isNumberedList , listLevel , listText , styleId ,
860+ isBulletList , isNumberedList , listLevel , listText , listTextBold , styleId ,
859861 bold , italic , fontSize , color , pageBreakBefore , pageBreakAfter , paragraphShading , tabStops ,
860862 sectionBreakLayout , borders , shapes . Count > 0 ? shapes : null ,
861863 ContextualSpacing : contextualSpacing , SnapToGrid : snapToGrid ,
@@ -3410,8 +3412,12 @@ private static Dictionary<string, DocxNumberingDef> ReadNumbering(ZipArchive arc
34103412 lvlHanging = lh / 20f ;
34113413 }
34123414 // Read bullet font name from rPr/rFonts (e.g. Wingdings, Symbol)
3413- var lvlFontName = lvl . Element ( W + "rPr" ) ? . Element ( W + "rFonts" ) ? . Attribute ( W + "ascii" ) ? . Value ;
3414- levels . Add ( new DocxNumberingLevelDef ( ilvl , numFmt , lvlText , startVal , lvlIndentLeft , lvlHanging , lvlFontName ) ) ;
3415+ var lvlRPr = lvl . Element ( W + "rPr" ) ;
3416+ var lvlFontName = lvlRPr ? . Element ( W + "rFonts" ) ? . Attribute ( W + "ascii" ) ? . Value ;
3417+ // Read bold from numbering level rPr (used for list label rendering)
3418+ var lvlBoldEl = lvlRPr ? . Element ( W + "b" ) ;
3419+ var lvlBold = lvlBoldEl != null && lvlBoldEl . Attribute ( W + "val" ) ? . Value is not ( "0" or "false" ) ;
3420+ levels . Add ( new DocxNumberingLevelDef ( ilvl , numFmt , lvlText , startVal , lvlIndentLeft , lvlHanging , lvlFontName , lvlBold ) ) ;
34153421 }
34163422 abstractDefs [ absId ] = levels ;
34173423 }
@@ -3496,6 +3502,7 @@ internal sealed record DocxParagraph(
34963502 bool IsNumberedList = false ,
34973503 int ListLevel = 0 ,
34983504 string ? ListText = null ,
3505+ bool ListTextBold = false ,
34993506 string ? StyleId = null ,
35003507 bool Bold = false ,
35013508 bool Italic = false ,
@@ -3833,4 +3840,4 @@ private static string ToRoman(int num)
38333840 }
38343841}
38353842
3836- internal sealed record DocxNumberingLevelDef ( int Ilvl , string NumFmt , string LvlText , int Start , float IndentLeft = 0 , float Hanging = 0 , string ? FontName = null ) ;
3843+ internal sealed record DocxNumberingLevelDef ( int Ilvl , string NumFmt , string LvlText , int Start , float IndentLeft = 0 , float Hanging = 0 , string ? FontName = null , bool Bold = false ) ;
0 commit comments