Extract description HTML from inline content after the first link. AST: [link("name"), text(" - Description.")] -> "Description." The separator (- / en-dash / em-dash) is stripped.
(inline: SyntaxTreeNode, first_link: SyntaxTreeNode)
| 168 | |
| 169 | |
| 170 | def _extract_description_html(inline: SyntaxTreeNode, first_link: SyntaxTreeNode) -> str: |
| 171 | """Extract description HTML from inline content after the first link. |
| 172 | |
| 173 | AST: [link("name"), text(" - Description.")] -> "Description." |
| 174 | The separator (- / en-dash / em-dash) is stripped. |
| 175 | """ |
| 176 | link_idx = next((i for i, c in enumerate(inline.children) if c is first_link), None) |
| 177 | if link_idx is None: |
| 178 | return "" |
| 179 | desc_children = inline.children[link_idx + 1 :] |
| 180 | if not desc_children: |
| 181 | return "" |
| 182 | html = render_inline_html(desc_children) |
| 183 | return _DESC_SEP_RE.sub("", html) |
| 184 | |
| 185 | |
| 186 | def _parse_list_entries( |
no test coverage detected