File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1207,6 +1207,21 @@ class Caption extends XFAObject {
12071207 return HTMLResult . EMPTY ;
12081208 }
12091209
1210+ // For checkButton captions, add a non-breaking space at the beginning
1211+ // and replace all spaces with non-breaking spaces to prevent word wrapping
1212+ const parent = this [ $getParent ] ( ) ;
1213+ if ( parent ?. ui ?. checkButton && typeof value === "object" && value . children ) {
1214+ for ( const child of value . children ) {
1215+ if ( child . value && typeof child . value === "string" ) {
1216+ // Replace all regular spaces with non-breaking spaces
1217+ child . value = child . value . startsWith ( " " )
1218+ ? child . value . replace ( / / g, "\u00A0" )
1219+ : "\u00A0" + child . value . replace ( / / g, "\u00A0" ) ;
1220+ child . value = child . value . replace ( / \/ / g, "\u2044" ) ;
1221+ }
1222+ }
1223+ }
1224+
12101225 const savedReserve = this . reserve ;
12111226 if ( this . reserve <= 0 ) {
12121227 const { w, h } = this [ $getExtra ] ( availableSpace ) ;
You can’t perform that action at this time.
0 commit comments