nixos-render-docs: allow dots in heading ids

this is used by release notes (and we don't want to break links to
those), and is also technically allowed anyway. we will *not* extend the
regex to allow more characters just yet due to a mozilla recommendation
against it (cf https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id)
This commit is contained in:
pennae 2023-02-08 10:31:44 +01:00
parent fd9f6c7501
commit 6cd368870b

View file

@ -349,7 +349,7 @@ def _block_comment_plugin(md: markdown_it.MarkdownIt) -> None:
md.block.ruler.after("code", "block_comment", block_comment)
_HEADER_ID_RE = re.compile(r"\s*\{\s*\#([\w-]+)\s*\}\s*$")
_HEADER_ID_RE = re.compile(r"\s*\{\s*\#([\w.-]+)\s*\}\s*$")
def _heading_ids(md: markdown_it.MarkdownIt) -> None:
def heading_ids(state: markdown_it.rules_core.StateCore) -> None: