prismicio-community / java-kit

Community maintained development kit for Prismic and the Java language
https://prismic.io
15 stars 38 forks source link

asHtml on a block that only contains <ul> first causes the generation of an incorrectly nested list item #18

Closed jakeyr closed 10 years ago

jakeyr commented 10 years ago

If you call asHtml on a StructuredText block using the java kit and the content starts with a <ul>, the first list item (an <li> tag) is incorrectly positioned outside the <ul>.

the bug is at https://github.com/prismicio/java-kit/blob/master/src/main/java/io/prismic/Fragment.java#L706

notice the loop will not create a <ul> tag during the first pass through the group elements.

thanks!

jakeyr commented 10 years ago

I think this commit fixes it, although I have not fully tested it yet:

https://github.com/lendup/java-kit/commit/8b8ed4b57ea915210d8fefaa5e04d92152fce108?w=1

rudyrigot commented 10 years ago

Hey, thanks a lot for fixing this! For some reason, our test case worked well, and your fix didn't break it, and turns out to work for all cases, so I took the liberty to merge your commit to our master. Thanks a lot!