Commit b9bf1ec
committed
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.1 parent 6ce64dc commit b9bf1ec
3 files changed
Lines changed: 34 additions & 1 deletion
File tree
- src/resources/pandoc/datadir
- tests/docs/smoke-all/lua/quarto-utils-is-empty-node
| 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