Detect a bold-only paragraph used as a group marker. Pattern: a paragraph whose only content is **Group Name** (possibly surrounded by empty text nodes in the AST). Returns the group name text, or None if not a group marker.
(node: SyntaxTreeNode)
| 287 | |
| 288 | |
| 289 | def _is_bold_marker(node: SyntaxTreeNode) -> str | None: |
| 290 | """Detect a bold-only paragraph used as a group marker. |
| 291 | |
| 292 | Pattern: a paragraph whose only content is **Group Name** (possibly |
| 293 | surrounded by empty text nodes in the AST). |
| 294 | Returns the group name text, or None if not a group marker. |
| 295 | """ |
| 296 | if node.type != "paragraph": |
| 297 | return None |
| 298 | for child in node.children: |
| 299 | if child.type != "inline": |
| 300 | continue |
| 301 | # Filter out empty text nodes that markdown-it inserts around strong |
| 302 | meaningful = [c for c in child.children if not (c.type == "text" and c.content == "")] |
| 303 | if len(meaningful) == 1 and meaningful[0].type == "strong": |
| 304 | return render_inline_text(meaningful[0].children) |
| 305 | return None |
| 306 | |
| 307 | |
| 308 | def _parse_grouped_sections( |
no test coverage detected