-
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
StructuralNode#setLevel is missing #931
Comments
Honestly I never considered this property to be set by anybody else but the parser (or to be it simply computed from the level in the AST). Until then you can set the level like this: RubyObjectWrapper rubyBlock = (RubyObjectWrapper) block;
Ruby ruby = rubyBlock.getRubyObject().getRuntime();
rubyBlock.setRubyProperty("@level", ruby.newFixnum(42)); |
For reference, I'm using this method to "flatten" a document in order to have only first level sections (i.e. not nested sections).
gets transformed into:
(can be useful when you convert an AsciiDoc document into slides) |
I see, |
Fixes #931. Add method StructuralNode.setLevel()
Unless I'm missing something, I think that
setLevel
is missing fromStructuralNode
right?level
is defined as an attribute accessor so it should be possible to set the value:https://github.com/asciidoctor/asciidoctor/blob/cb7c20593344bda9bc968a619b02065d3401ad29/lib/asciidoctor/abstract_block.rb#L18-L19
In Ruby, I can do:
If the method is indeed missing, is there a workaround? (i.e. casting the objet to access low-level methods?)
The text was updated successfully, but these errors were encountered: