nixos/make-options-doc: eat newlines in MD admonitions

leaving some newlines around after an admonition was closed causes the
newline rule to match, which in turn inserts literallayout newlines into
te xml output. that's not what we want.
This commit is contained in:
pennae 2022-08-20 23:21:30 +02:00 committed by pennae
parent 51a11254a7
commit 65fd6f0774

View file

@ -151,7 +151,7 @@ def p_manpage(md):
md.inline.rules.append('manpage')
def p_admonition(md):
ADMONITION_PATTERN = re.compile(r'^::: \{([^\n]*?)\}\n(.*?)^:::\n', flags=re.MULTILINE|re.DOTALL)
ADMONITION_PATTERN = re.compile(r'^::: \{([^\n]*?)\}\n(.*?)^:::$\n*', flags=re.MULTILINE|re.DOTALL)
def parse(self, m, state):
return {
'type': 'admonition',