Skip to content

Commit 05c8cdb

Browse files
committed
role nodes should not inherit from Body
This causes them to be ignored in inline parsing mode.
1 parent f4635bd commit 05c8cdb

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

snooty/gizaparser/test_steps.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ def create_page() -> Tuple[Page, EmbeddedRstParser]:
5252
'</target></paragraph></section></directive>',
5353

5454
'<directive name="step"><section><heading><text>Create a </text><literal><text>',
55-
'/etc/apt/sources.list.d/mongodb-org-3.4.list</text></literal><text> file for MongoDB.',
56-
'</text></heading>',
55+
'/etc/apt/sources.list.d/mongodb-org-3.4.list</text></literal><text> file for </text>',
56+
'<role name="guilabel" label="MongoDB" target="MongoDB" raw="MongoDB"></role>',
57+
'<text>.</text></heading>',
5758
'<section><heading><text>Optional: action heading</text></heading>'
5859
'<paragraph><text>Create the list file using the command appropriate for ',
5960
'your version\nof Debian.</text></paragraph>',

snooty/rstparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class code(docutils.nodes.General, docutils.nodes.FixedTextElement):
5555
pass
5656

5757

58-
class role(docutils.nodes.General, docutils.nodes.Inline, docutils.nodes.Element):
58+
class role(docutils.nodes.Inline, docutils.nodes.Element):
5959
def __init__(self, name: str, rawtext: str, text: str, lineno: int) -> None:
6060
super(role, self).__init__()
6161
self['name'] = name

test_data/steps-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source:
44
file: steps-test-child.yaml
55
ref: import-key
66
---
7-
title: Create a ``/etc/apt/sources.list.d/mongodb-org-{+version+}.list`` file for MongoDB.
7+
title: Create a ``/etc/apt/sources.list.d/mongodb-org-{+version+}.list`` file for :guilabel:`MongoDB`.
88
stepnum: 2
99
level: 4
1010
ref: sources-list

0 commit comments

Comments
 (0)