File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55- Used fetch API for downloading fonts and images
66- Update Roboto font (version 3.014)
7+ - Fixed render empty list entries
78
89## 0.3.0-beta.18 - 2025-05-09
910
Original file line number Diff line number Diff line change @@ -388,6 +388,23 @@ var docDefinition = {
388388 { text : 'item 3' , listType : 'circle' }
389389 ]
390390 } ,
391+ { text : '\n\nOrdered list with an empty item:' , style : 'header' } ,
392+ {
393+ ol : [
394+ 'First item' ,
395+ 'Second item' ,
396+ '' ,
397+ 'Fourth item'
398+ ]
399+ } ,
400+ { text : '\n\nUnordered list with an empty item:' , style : 'header' } ,
401+ {
402+ ul : [
403+ 'First bullet' ,
404+ '' ,
405+ 'Third bullet'
406+ ]
407+ } ,
391408 ] ,
392409 styles : {
393410 header : {
Original file line number Diff line number Diff line change @@ -72,7 +72,17 @@ class LayoutBuilder {
7272 return false ;
7373 }
7474
75- linearNodeList = linearNodeList . filter ( node => node . positions . length > 0 ) ;
75+ const hasRenderableContent = node => {
76+ if ( ! node || node . positions . length === 0 ) {
77+ return false ;
78+ }
79+ if ( node . text === '' && ! node . listMarker ) {
80+ return false ;
81+ }
82+ return true ;
83+ } ;
84+
85+ linearNodeList = linearNodeList . filter ( hasRenderableContent ) ;
7686
7787 linearNodeList . forEach ( node => {
7888 let nodeInfo = { } ;
Original file line number Diff line number Diff line change @@ -9,12 +9,22 @@ import StyleContextStack from './StyleContextStack';
99 */
1010const splitWords = ( text , noWrap ) => {
1111 let words = [ ] ;
12+ if ( text === undefined || text === null ) {
13+ text = '' ;
14+ } else {
15+ text = String ( text ) ;
16+ }
1217
1318 if ( noWrap ) {
1419 words . push ( { text : text } ) ;
1520 return words ;
1621 }
1722
23+ if ( text . length === 0 ) {
24+ words . push ( { text : '' } ) ;
25+ return words ;
26+ }
27+
1828 let breaker = new LineBreaker ( text ) ;
1929 let last = 0 ;
2030 let bk ;
You can’t perform that action at this time.
0 commit comments