prismicio-community / php-kit

Community maintained development kit for Prismic and the PHP language
https://prismic.io
Other
109 stars 83 forks source link

Wrong nesting of the output when calling getHtml method on item list #47

Closed barrycarton closed 10 years ago

barrycarton commented 10 years ago

When calling the getHtml() method on a unordered list from a StructuredText field the list the first element is wrongfully rendered as a sibling of its expected parent (<ul>);

$document->getHtml("local_product.ksps")

Raw output of the function :

<li>Chaudière murale gaz à condensation à très haut rendement</li><ul><li>Chaudière double service, avec ballon eau chaude sanitaire 62 litres</li><li>Echangeur en acier inoxydable auto-nettoyant: résistance sans pareille à la corrosion</li><li>Brûleur à pré-mélange, gaz naturel ou propane</li><li>Avec vase d’expansion 12 litres</li><li>Raccordement ventouse en standard</li><li>Kits hydrauliques et accessoires de régulation en option</li></ul>

Note that the <ul> tag start after the first <li> element.

I saw no test in the suite adressing this specific use case. It should be fairly easy to reproduce.

Similar problem arises with ordered lists. Feels free to ask me to file a new issue.

Screenshot of the API browser

rudyrigot commented 10 years ago

Alright, I found it, and just turned this into a PR. It makes sense that no one found it out so far: it only was a problem when trying to serialize a structured text whose first block is a list item.

barrycarton commented 10 years ago

Neat. Thanks!