mirror of
https://github.com/vale981/releases
synced 2025-03-04 17:21:43 -05:00
Clean up BulletListVisitor & nuke node from element as before
This commit is contained in:
parent
504b4bc48e
commit
b57b8e2445
1 changed files with 5 additions and 2 deletions
|
@ -415,15 +415,18 @@ def construct_nodes(releases):
|
|||
|
||||
|
||||
class BulletListVisitor(nodes.NodeVisitor):
|
||||
|
||||
def __init__(self, document):
|
||||
nodes.NodeVisitor.__init__(self, document)
|
||||
self.changelog = None
|
||||
|
||||
def visit_bullet_list(self, node):
|
||||
# find the first one
|
||||
# The first found bullet list (which should be the first one at the top
|
||||
# level of the document) is the changelog.
|
||||
if not self.changelog:
|
||||
self.changelog = node
|
||||
# Remove it from the document so it's not hanging around at the end
|
||||
# after we build the changelogs back out.
|
||||
node.replace_self([])
|
||||
|
||||
def unknown_visit(self, node):
|
||||
pass
|
||||
|
|
Loading…
Add table
Reference in a new issue