| @@ -326,8 +326,28 @@ | ||
| 326 | 326 | |
| 327 | 327 | return $this->children; |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | + public function render_markdown(): string { | |
| 331 | + $children = $this->get_children(); | |
| 332 | + | |
| 333 | + if ( empty( $children ) ) { | |
| 334 | + return ''; | |
| 335 | + } | |
| 336 | + | |
| 337 | + $parts = []; | |
| 338 | + | |
| 339 | + foreach ( $children as $child ) { | |
| 340 | + $md = $child->render_markdown(); | |
| 341 | + | |
| 342 | + if ( ! empty( trim( $md ) ) ) { | |
| 343 | + $parts[] = $md; | |
| 344 | + } | |
| 345 | + } | |
| 346 | + | |
| 347 | + return implode( "\n\n", $parts ); | |
| 348 | + } | |
| 349 | + | |
| 330 | 350 | /** |
| 331 | 351 | * Get default arguments. |
| 332 | 352 | * |
| 333 | 353 | * Retrieve the element default arguments. Used to return all the default |