diff options
author | Stuart Rackham <srackham@methods.co.nz> | 2009-04-23 13:47:08 +1200 |
---|---|---|
committer | Stuart Rackham <srackham@methods.co.nz> | 2009-04-23 13:47:08 +1200 |
commit | 1df2810e627f7ba66cf276da461acc7f95f2f642 (patch) | |
tree | 6fc2d9d4fd951b99db3d55e1496c0405a3535186 /asciidoc.py | |
parent | 730b60bfcd80dbf4e960d614270c4df882d2e45f (diff) | |
download | asciidoc-py3-1df2810e627f7ba66cf276da461acc7f95f2f642.tar.gz |
FIXED: All conbinations of leading comments and attribute entries are now skipped correctly.
Diffstat (limited to 'asciidoc.py')
-rwxr-xr-x | asciidoc.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/asciidoc.py b/asciidoc.py index f1b3464..5e69f73 100755 --- a/asciidoc.py +++ b/asciidoc.py @@ -1187,14 +1187,19 @@ class Document: 'illegal document type' assert self.level == 0 config.expand_all_templates() - # Skip leading comment block. - if blocks.isnext() and 'skip' in blocks.current.options: - blocks.current.translate() - # Skip leading comment lines. - while macros.isnext() and macros.current.name == 'comment': - macros.current.translate() - # Skip leading attribute entries. - AttributeEntry.translate_all() + # Skip leading comments and attribute entries. + finished = False + while not finished: + finished = True + if blocks.isnext() and 'skip' in blocks.current.options: + finished = False + blocks.current.translate() + if macros.isnext() and macros.current.name == 'comment': + finished = False + macros.current.translate() + if AttributeEntry.isnext(): + finished = False + AttributeEntry.translate() # Process document header. has_header = Lex.next() is Title and Title.level == 0 if self.doctype == 'manpage' and not has_header: |