Skip to content
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

Add method AbstractBlock.append(AbstractNode) to add a child node to a block #325

Closed
robertpanzer opened this issue Jun 3, 2015 · 5 comments
Assignees
Milestone

Comments

@robertpanzer
Copy link
Member

See http://discuss.asciidoctor.org/AsciidoctorJ-Block-Processor-Problems-tp3150p3297.html:

As you can see from my previous message, we are missing two key methods in the AsciidoctorJ API.

First, we need to add the append method to the AbstractBlock interface. This method allows child blocks to be added to a block.

@robertpanzer
Copy link
Member Author

@mojavelinux: Shouldn't this already work like this?

AbstractBlock newBlock = createBlock(block,...);
block.getBlocks().add(newBlock);

@mojavelinux
Copy link
Member

Aha! That is true. I didn't think about that since I always use the append method internally in Asciidoctor core.

I think we should still add the method though. But it's good to know that it's no longer a showstopper.

@mojavelinux
Copy link
Member

Keep in mind the append method is important because, in the future, we may augment the method to automatically reparent the node (just like in DOM).

@mojavelinux
Copy link
Member

...and that would be why I am consistent about using the append method in core.

robertpanzer added a commit to robertpanzer/asciidoctorj that referenced this issue Jun 13, 2015
@robertpanzer robertpanzer added this to the v1.6.0 milestone Jun 13, 2015
@robertpanzer robertpanzer self-assigned this Jun 13, 2015
robertpanzer added a commit to robertpanzer/asciidoctorj that referenced this issue Jun 14, 2015
robertpanzer added a commit to robertpanzer/asciidoctorj that referenced this issue Jun 14, 2015
robertpanzer added a commit to robertpanzer/asciidoctorj that referenced this issue Jul 29, 2015
@robertpanzer
Copy link
Member Author

Fixed with #337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants