Commit f916d38
committed
Ensure at least one location per section
Previously, if a book had no text content in a section, then no location
would be generated. In the pathological case of a book with no text
content at all (pictures only), no locations are generated for the
entire book. An example of this is the Open Circuits EPUB from No Starch
Press (2023).
By moving the "empty node" detection after the creation of the initial
opening range, the parsing code ensures that a minimum of one location
is generated per section.
Signed-off-by: Ross Williams <ross@ross-williams.net>1 parent f09089c commit f916d38
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | 107 | | |
112 | | - | |
| 108 | + | |
113 | 109 | | |
114 | 110 | | |
115 | 111 | | |
116 | 112 | | |
117 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
0 commit comments