(node: Any)
| 261 | |
| 262 | |
| 263 | def _render_blockquote(node: Any) -> Text: |
| 264 | inner_blocks: list[Text] = [] |
| 265 | for child in node.children or []: |
| 266 | if child.type in ("fence", "code_block"): |
| 267 | inner_blocks.append(_render_code_as_text(child)) |
| 268 | continue |
| 269 | rendered = _render_block(child) |
| 270 | if isinstance(rendered, Text): |
| 271 | inner_blocks.append(rendered) |
| 272 | |
| 273 | combined = Text() |
| 274 | for i, block in enumerate(inner_blocks): |
| 275 | if i > 0: |
| 276 | combined.append("\n\n") |
| 277 | combined.append_text(block) |
| 278 | combined.stylize("italic") |
| 279 | |
| 280 | lines = combined.split("\n", allow_blank=True) |
| 281 | out = Text() |
| 282 | for i, line in enumerate(lines): |
| 283 | if i > 0: |
| 284 | out.append("\n") |
| 285 | if line.plain.strip(): |
| 286 | out.append(f"{BLOCKQUOTE_BAR} ", style="dim") |
| 287 | out.append_text(line) |
| 288 | else: |
| 289 | out.append_text(line) |
| 290 | return out |
| 291 | |
| 292 | |
| 293 | def _render_table(node: Any) -> Text: |
no test coverage detected