diff options
author | pennae <github@quasiparticle.net> | 2023-01-18 00:07:01 +0100 |
---|---|---|
committer | pennae <82953136+pennae@users.noreply.github.com> | 2023-01-22 17:50:09 +0100 |
commit | 2cb43da5870b6f0d3beb64afdce3cb8a04a071fc (patch) | |
tree | 3995fd53b9216ac70ab5ac873904560405824d5f /nixos/lib | |
parent | e067d9e33e1af155cddbe835bb06573a5ae38a02 (diff) |
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.
Diffstat (limited to 'nixos/lib')
-rw-r--r-- | nixos/lib/make-options-doc/mergeJSON.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/nixos/lib/make-options-doc/mergeJSON.py b/nixos/lib/make-options-doc/mergeJSON.py index 3108b9e2197fa..c27cd9d3c6ddb 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}><para>{text.rstrip()}</para></{tag}>" def block_quote(self, text): return f"<blockquote><para>{text}</para></blockquote>" @@ -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 |