Commit 96dc728
authored
Fix inverted logic in quarto.utils.is_empty_node for text nodes (#14297)
* Fix inverted logic in quarto.utils.is_empty_node for text nodes
The text branch (`node.text`) used `~=` (not-equal) where it should
use `==` (equal), causing is_empty_node to return true for non-empty
text nodes and false for empty ones.
Text nodes like Str and Code should follow the same emptiness
semantics as container nodes like Para and Div: a Str('') is empty
just as Para({}) is empty -- a node of the right type but with
nothing in it.
Internal callers all pass container nodes (caption, preamble) so
nothing was visibly broken, but extension authors calling the public
API on text nodes get wrong results.
* Add changelog entry for is_empty_node fix (#14297)1 parent 03138ed commit 96dc728
4 files changed
Lines changed: 38 additions & 1 deletion
File tree
- news
- src/resources/pandoc/datadir
- tests/docs/smoke-all/lua/quarto-utils-is-empty-node
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
| 595 | + | |
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments