Setting Id of newly created block in extension

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting Id of newly created block in extension

Daniel K
Hi,

I am using asciidoctorj-1.5.6 to write an extension based on a TreeProcessor.

I am using createBlock to create a new block based on an existing one and I am taking over all attributes from the existing one:

        Block block = proc.createBlock((AbstractBlock) originalBlock.getParent(),originalBlock.getContext(),null,originalBlock.getAttributes(),options);

The original block had an id:

originalBlock.id() --> myid

In HTML: <div id="myid">

The newly created block hasn't one:

block.id() --> null

How can I set the id of the new block?

Due to constraints in my development environment, I am not able to migrate to version 1.6 or even 2.x of asciidoctorj.
I tried to upgrade but I stepped into the depencency hell (we are using as well the gradle plugin with a derived AsciidoctorTask, asciidoctor-diagram, ....

Thanks!

Regards,

Daniel

Reply | Threaded
Open this post in threaded view
|

Re: Setting Id of newly created block in extension

Daniel K
I managed to update to asciidoctorj 1.6.1.
Here a setId() method is available. With this, it works.
Thanks!