diff --git a/org_rw/org_rw.py b/org_rw/org_rw.py index e616f05..8ee4ddb 100644 --- a/org_rw/org_rw.py +++ b/org_rw/org_rw.py @@ -1673,7 +1673,7 @@ class OrgDoc: yield from headline.get_code_snippets() # Writing - def dump_headline(self, headline): + def dump_headline(self, headline, recursive=True): tags = "" if len(headline.shallow_tags) > 0: @@ -1746,8 +1746,9 @@ class OrgDoc: content = content[:-1] yield content - for child in headline.children: - yield from self.dump_headline(child) + if recursive: + for child in headline.children: + yield from self.dump_headline(child, recursive=recursive) def dump(self): lines = []