Merge pull request #246996 from pennae/nrd-empty-inlines
nixos-render-docs: fix empty inlines
This commit is contained in:
commit
6fca6f9d5b
|
@ -623,7 +623,7 @@ class HTMLConverter(BaseConverter[ManualHTMLRenderer]):
|
||||||
elif bt.type == 'footnote_ref' and (id := cast(str, bt.attrs.get('id', ''))):
|
elif bt.type == 'footnote_ref' and (id := cast(str, bt.attrs.get('id', ''))):
|
||||||
result.append(XrefTarget(id, "???", None, None, target_file))
|
result.append(XrefTarget(id, "???", None, None, target_file))
|
||||||
elif bt.type == 'inline':
|
elif bt.type == 'inline':
|
||||||
assert bt.children
|
assert bt.children is not None
|
||||||
result += self._collect_ids(bt.children, target_file, typ, False)
|
result += self._collect_ids(bt.children, target_file, typ, False)
|
||||||
elif id := cast(str, bt.attrs.get('id', '')):
|
elif id := cast(str, bt.attrs.get('id', '')):
|
||||||
# anchors and examples have no titles we could use, but we'll have to put
|
# anchors and examples have no titles we could use, but we'll have to put
|
||||||
|
|
|
@ -458,7 +458,7 @@ def _footnote_ids(md: markdown_it.MarkdownIt) -> None:
|
||||||
token.attrs['id'] = f'{token.meta["label"]}.__back.{token.meta["subId"]}'
|
token.attrs['id'] = f'{token.meta["label"]}.__back.{token.meta["subId"]}'
|
||||||
token.meta['target'] = token.meta["label"]
|
token.meta['target'] = token.meta["label"]
|
||||||
elif token.type == 'inline':
|
elif token.type == 'inline':
|
||||||
assert token.children
|
assert token.children is not None
|
||||||
generate_ids(token.children)
|
generate_ids(token.children)
|
||||||
|
|
||||||
def footnote_ids(state: markdown_it.rules_core.StateCore) -> None:
|
def footnote_ids(state: markdown_it.rules_core.StateCore) -> None:
|
||||||
|
|
Loading…
Reference in a new issue