From e11cac622e7608327d17d2a140a580370476b0e4 Mon Sep 17 00:00:00 2001 From: pennae Date: Sun, 24 Sep 2023 20:11:16 +0200 Subject: [PATCH] nixos-render-docs: fix tests for markdown-it-py 3 parsing of escaped text has changed internally, but apart from Token field contents that we only inspect in tests the change is *mostly* invisible to us. some bits of documentation now parse differently and need to be adjusted, but those were slightly questionable to begin with. --- pkgs/tools/nix/nixos-render-docs/src/tests/test_plugins.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/nix/nixos-render-docs/src/tests/test_plugins.py b/pkgs/tools/nix/nixos-render-docs/src/tests/test_plugins.py index 8564297efdd3..26fdcea907dd 100644 --- a/pkgs/tools/nix/nixos-render-docs/src/tests/test_plugins.py +++ b/pkgs/tools/nix/nixos-render-docs/src/tests/test_plugins.py @@ -208,7 +208,7 @@ def test_attr_span_escaping() -> None: content='\\[a]{#bar}', markup='', info='', meta={}, block=True, hidden=False, children=[ Token(type='text', tag='', nesting=0, attrs={}, map=None, level=0, children=None, - content='[a]{#bar}', markup='', info='', meta={}, block=False, hidden=False) + content='[a]{#bar}', markup='\\[', info='escape', meta={}, block=False, hidden=False) ]), Token(type='paragraph_close', tag='p', nesting=-1, attrs={}, map=None, level=0, children=None, content='', markup='', info='', meta={}, block=True, hidden=False) @@ -220,7 +220,7 @@ def test_attr_span_escaping() -> None: content='\\\\[a]{#bar}', markup='', info='', meta={}, block=True, hidden=False, children=[ Token(type='text', tag='', nesting=0, attrs={}, map=None, level=0, children=None, - content='\\', markup='', info='', meta={}, block=False, hidden=False), + content='\\', markup='\\\\', info='escape', meta={}, block=False, hidden=False), Token(type='attr_span_begin', tag='span', nesting=1, attrs={'id': 'bar'}, map=None, level=0, children=None, content='', markup='', info='', meta={}, block=False, hidden=False), Token(type='text', tag='', nesting=0, attrs={}, map=None, level=1, children=None, @@ -237,7 +237,7 @@ def test_attr_span_escaping() -> None: Token(type='inline', tag='', nesting=0, attrs={}, map=[0, 1], level=1, children=[ Token(type='text', tag='', nesting=0, attrs={}, map=None, level=0, children=None, - content='\\[a]{#bar}', markup='', info='', meta={}, block=False, hidden=False) + content='\\[a]{#bar}', markup='\\\\', info='escape', meta={}, block=False, hidden=False) ], content='\\\\\\[a]{#bar}', markup='', info='', meta={}, block=True, hidden=False), Token(type='paragraph_close', tag='p', nesting=-1, attrs={}, map=None, level=0, children=None,