-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes and Extensions to the IncludeProcessor and Reader classes #537
Fixes and Extensions to the IncludeProcessor and Reader classes #537
Conversation
… not have an inner document.
…tributes of a block that was previously created by a block processor.
- Fixed handles method in IncludeProcessor. - Added methods to ReaderImpl. - Added anonymous attributes to IncludeProcessor.
- Fixed handles method in IncludeProcessor. - Added anonymous attributes to IncludeProcessor.
Awesome, thank you! I am personally ok with mapping the positional args to the strings "1", "2", ... Could you please check why the tests are failing on Travis with Java 7? Another – maybe pedantic – note: Could you please check the indentation of the source code? Looks like you're using Tabs instead of Spaces which makes the code look a bit weird on Github. |
I believe that will solve some other type issues we were having. I was using numbers here to avoid collision with attributes that have the same name, but we could just say that numeric keys (1=value) are reserved for another purpose and should not be declared explicitly.
Do you mean positional attributes (value only)? If so, could you update the terminology? (See http://asciidoctor.org/docs/user-manual/#setting-attributes-on-an-element) If I try using an IncludeProcessor written in Ruby, I get these attributes:
gives me:
So effectively this fix translates those numeric keys into string keys, correct? |
Btw, thanks for this fix! |
👍 |
Thanks for your feedback!
|
Sorry for responding so late! I just tried out the failing test.
You might simply want to either sort the entries by key ("1", "2" and "3") or just test if the expected substrings are present. |
* | ||
* @return file name | ||
*/ | ||
public String getFile(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, could you please change these tabs to spaces?
(Sorry, but I am pretty opinionated on this 😁
@Override | ||
public String getFile() { | ||
IRubyObject rObj = getRubyProperty("file"); | ||
return rObj.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
@@ -395,6 +396,42 @@ public void a_include_instance_processor_should_be_executed_when_include_macro_i | |||
} | |||
|
|||
@Test | |||
public void a_include_processor_should_only_handle_its_handles() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well, tabs.
@robertpanzer thanks a lot for your advice! Hopefully the tests will be green now! |
@robertpanzer, I don't know the cause of the error. The message says, I should look at |
Awesome! |
@mmews-n4 The full report is not accessible now, but the output shows this Highly likely, to be related to this: https://github.com/robertpanzer/asciidoctorj-pdf/issues/3 |
This PR includes the following three changes:
Fix of IncludeProcessor#handles method
The handles(String) method in the IncludeProcessor is not called, because the annotation on the IncludeProcessorProxy#handles method lacks a question mark. Test case added.
Extended IncludeProcessor to accept positional attributes
Before, the IncludeProcessor ignored any positional attributes. Now they can be used separated by commas. Internally, they are key value pairs where the keys are numbered accordingly to their order in the squared macros. The fix is only that these key value pairs are also evaluated when constructing the attributes map. Test case added.
Extended Reader and ReaderImpl
The reader now provides the methods getFile and getDir which are delegated to 'file' and 'dir' of asciidoctor.