diff options
author | Matthew Peveler <matt.peveler@gmail.com> | 2020-06-02 04:43:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-01 21:43:27 -0400 |
commit | 50957a758385b55df6ae704e6f165833abe83953 (patch) | |
tree | d00e03899db439a76e4cd7982e0435fffee434ff | |
parent | 07fa7df5268eb369b7f72e0ff506b6d43218e9a8 (diff) | |
download | asciidoc-py3-50957a758385b55df6ae704e6f165833abe83953.tar.gz |
fix handling of options attribute for DelimintedBlock (#120)
When attempting to do something like:
["test",options="textual"]
--------------------
Hello
--------------------
The options would not be parsed per the spec (https://asciidoc.org/userguide.html#X75) where you would not get textual-option as one of the attributes. The cause of this is 0b7a7d4 where AttributeList.consume was no longer being called with an argument we were using to hold all our attributes. Within this function is the special handling of the options attribute into parts that was no longer being called.
This re-adds special handling to get the expected <__>-option attributes out of options while retaining the behavior introduced in that patch. This is somewhat similar to how the Table works (in that it has its own inline parsing of options to have it work).
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
-rw-r--r-- | CHANGELOG.txt | 1 | ||||
-rwxr-xr-x | asciidoc.py | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0907421..61eafea 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -27,6 +27,7 @@ Version 9.0.0 (Unreleased) - Properly capture and use colophon, dedication, and preface for docbooks in Japanese (see https://github.com/asciidoc/asciidoc-py3/pull/2#issuecomment-392623181) - make install did not include the unwraplatex.py filter - Fix a2x option collection from input file with non-ascii encoding +- Fix options attribute not being properly parsed in Delimited Blocks attribute list .Building - Migrate from hierarchical A-A-P build system to top-level Makefile diff --git a/asciidoc.py b/asciidoc.py index f5c04cf..d9c00ff 100755 --- a/asciidoc.py +++ b/asciidoc.py @@ -3137,6 +3137,10 @@ class DelimitedBlock(AbstractBlock): if 'skip' not in self.parameters.options: BlockTitle.consume(self.attributes) AttributeList.consume() + if 'options' in self.attributes: + options = parse_options(self.attributes['options'], (), 'illegal option name') + for option in options: + self.attributes[option + '-option'] = '' self.push_blockname() options = self.parameters.options if 'skip' in options: |