… of return a list of DescriptionListItems, which are not blocks
Thank you for opening a pull request and contributing to AsciidoctorJ!
Please take a bit of time giving some details about your pull request:
Kind of change
[x] Bug fix
[ ] New non-breaking feature
[ ] New breaking feature
[ ] Documentation update
[ ] Build improvement
Description
What is the goal of this pull request?
1082 reports that DescriptionList.getSections() returns a list of objects that are not StructuralNodes but DescriptionListEntries instead. (This only works due to type erasure).
How does it achieve that?
This PR tries to fix the problem by making DescriptionList.getSections() return a new empty list.
That way there will no longer be a ClassCastException when recursively traversing the AST only via getSections().
Are there any alternative ways to implement this?
It could be possible to change the form of the AST by making DescriptionListEntry a StructuralNode that has the terms as properties.
That might be difficult as the implementation of Asciidoctor Ruby currently treats the terms and its description as a list with 2 items: [[ListItem Term1, ListItem Term2], ListItem Description].
This might be difficult to implement, leaves the question open how to handle description list entries without description and also this would be a breaking change.
Are there any implications of this pull request? Anything a user must know?
Adding any nodes to the result of DescriptionList.getSections() is without any effect.
Issue
Fixes #1082
Release notes
Please add a corresponding entry to the file CHANGELOG.adoc
… of return a list of DescriptionListItems, which are not blocks
Thank you for opening a pull request and contributing to AsciidoctorJ!
Please take a bit of time giving some details about your pull request:
Kind of change
Description
What is the goal of this pull request?
1082 reports that DescriptionList.getSections() returns a list of objects that are not StructuralNodes but DescriptionListEntries instead. (This only works due to type erasure).
How does it achieve that?
This PR tries to fix the problem by making DescriptionList.getSections() return a new empty list. That way there will no longer be a ClassCastException when recursively traversing the AST only via getSections().
Are there any alternative ways to implement this?
It could be possible to change the form of the AST by making DescriptionListEntry a StructuralNode that has the terms as properties. That might be difficult as the implementation of Asciidoctor Ruby currently treats the terms and its description as a list with 2 items:
[[ListItem Term1, ListItem Term2], ListItem Description]
. This might be difficult to implement, leaves the question open how to handle description list entries without description and also this would be a breaking change.Are there any implications of this pull request? Anything a user must know?
Adding any nodes to the result of DescriptionList.getSections() is without any effect.
Issue
Fixes #1082
Release notes
Please add a corresponding entry to the file CHANGELOG.adoc