From 2cb43da5870b6f0d3beb64afdce3cb8a04a071fc Mon Sep 17 00:00:00 2001 From: pennae Date: Wed, 18 Jan 2023 00:07:01 +0100 Subject: [PATCH] nixos/make-options-doc: remove trailing whitespace from strings this was done only to make the conversion to MD easier to verify. we no longer need it, and not keeping whitespace does not affect rendered outputs. stripping will have to stay for now because description postprocessing would add empty paragraphs otherwise. --- nixos/lib/make-options-doc/mergeJSON.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nixos/lib/make-options-doc/mergeJSON.py b/nixos/lib/make-options-doc/mergeJSON.py index 3108b9e2197f..c27cd9d3c6dd 100644 --- a/nixos/lib/make-options-doc/mergeJSON.py +++ b/nixos/lib/make-options-doc/mergeJSON.py @@ -105,9 +105,6 @@ class Renderer(mistune.renderers.BaseRenderer): if kind not in admonitions: raise NotImplementedError(f"admonition {kind} not supported yet") tag = admonitions[kind] - # we don't keep whitespace here because usually we'll contain only - # a single paragraph and the original docbook string is no longer - # available to restore the trailer. return f"<{tag}>{text.rstrip()}" def block_quote(self, text): return f"
{text}
" @@ -196,8 +193,7 @@ def convertMD(options: Dict[str, Any]) -> str: def convertString(path: str, text: str) -> str: try: rendered = md(text) - # keep trailing spaces so we can diff the generated XML to check for conversion bugs. - return rendered.rstrip() + text[len(text.rstrip()):] + return rendered.rstrip() except: print(f"error in {path}") raise