Commit 0799e19
authored
fix: set prev token in render_list_item and add block_text to ignore_blocks (#456)
* fix: set prev token in render_list_item and add block_text to ignore_blocks
The RSTRenderer.block_quote method accesses token.prev to decide
whether to emit a .. separator before the blockquote. When a
blockquote appears inside a list item, render_list_item called
renderer.render_token directly without tracking prev, so
blockquote tokens never received a prev reference. This caused a
KeyError in older versions and silently degraded output in the
current version (missing or incorrect .. separators).
- Track prev in render_list_item, mirroring how RSTRenderer.iter_tokens
already does for top-level tokens.
- Add block_text (the list-internal paragraph token type) to the
ignore_blocks tuple so a blockquote following list-internal text
does not get a spurious .. separator.
* Test RST list item blockquote separation1 parent 10c918d commit 0799e19
3 files changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
0 commit comments