diff --git a/myst_parser/docutils_renderer.py b/myst_parser/docutils_renderer.py index 0b1f9d41..d6b61645 100644 --- a/myst_parser/docutils_renderer.py +++ b/myst_parser/docutils_renderer.py @@ -818,7 +818,7 @@ def dict_to_fm_field_list( if key in bibliofields: para_nodes, _ = state.inline_text(value, line) else: - para_nodes = [nodes.Text(value, value)] + para_nodes = [nodes.literal(value, value)] body_children = [nodes.paragraph("", "", *para_nodes)] body_children[0].source = self.document["source"] diff --git a/tests/test_renderers/fixtures/docutil_syntax_elements.md b/tests/test_renderers/fixtures/docutil_syntax_elements.md index 78fb45d3..2af1cdc2 100644 --- a/tests/test_renderers/fixtures/docutil_syntax_elements.md +++ b/tests/test_renderers/fixtures/docutil_syntax_elements.md @@ -595,19 +595,22 @@ c: a - 1 + + 1 b - foo + + foo c - {"d": 2} + + {"d": 2} . -------------------------- @@ -725,7 +728,8 @@ other: Something else other - Something else + + Something else . -------------------------- @@ -827,7 +831,8 @@ a = 1 a - 1 + + 1
diff --git a/tests/test_renderers/fixtures/sphinx_syntax_elements.md b/tests/test_renderers/fixtures/sphinx_syntax_elements.md index a20a7f5a..95d6193c 100644 --- a/tests/test_renderers/fixtures/sphinx_syntax_elements.md +++ b/tests/test_renderers/fixtures/sphinx_syntax_elements.md @@ -632,19 +632,22 @@ c: a <field_body> <paragraph> - 1 + <literal> + 1 <field> <field_name> b <field_body> <paragraph> - foo + <literal> + foo <field> <field_name> c <field_body> <paragraph> - {"d": 2} + <literal> + {"d": 2} . -------------------------- @@ -762,7 +765,8 @@ other: Something else other <field_body> <paragraph> - Something else + <literal> + Something else . -------------------------- @@ -864,7 +868,8 @@ a = 1 a <field_body> <paragraph> - 1 + <literal> + 1 <target ids="target" names="target"> <section ids="header-1" names="header\ 1"> <title> diff --git a/tests/test_sphinx/sourcedirs/basic/content.md b/tests/test_sphinx/sourcedirs/basic/content.md index e3872f34..ab7b6e2f 100644 --- a/tests/test_sphinx/sourcedirs/basic/content.md +++ b/tests/test_sphinx/sourcedirs/basic/content.md @@ -17,6 +17,8 @@ dedication: | abstract: Something something **dark** side other: Something else +other_dict: + key: value --- (target)= diff --git a/tests/test_sphinx/test_sphinx_builds.py b/tests/test_sphinx/test_sphinx_builds.py index f05ef992..351f6b7d 100644 --- a/tests/test_sphinx/test_sphinx_builds.py +++ b/tests/test_sphinx/test_sphinx_builds.py @@ -66,6 +66,7 @@ def test_basic( "date": "2/12/1985", "copyright": "MIT", "other": "Something else", + "other_dict": '{"key": "value"}', "wordcount": {"minutes": 0, "words": 57}, }