zestedesavoir / zmarkdown

Live demo: https://zestedesavoir.github.io/zmarkdown/
MIT License
224 stars 52 forks source link

remark-captions: remove one image when Figure follows two images #479

Open artragis opened 1 year ago

artragis commented 1 year ago

input

![Configuration du projet de test avec IntelliJ, on donne le nom "tuto" au projet puis on sélectionne maven en tant que système de build](/media/galleries/502/3b362168-4ea0-4698-b92b-319c902b8fe1.png)
![Résultat de la configuration : un arbre est créé avec le dossier .idea, le dossier src et le fichier pom.xml. Dans le dossier src on a un dossier main et un dossier test, ces deux derniers ont un dossier java](/media/galleries/502/b09e3d72-f0e6-4ba4-b4b4-d9a11a8a9981.png)
Figure: Configuration de notre projet et hiérarchie qui en résulte

optained

Only one image is displayed image

Expected

Two possibilities :

StaloneLab commented 1 year ago

Thanks for reporting, this looks like a tricky problem. To make it clear, because I thought the behavior was intended at first: the problem does not happen when the Figure: caption is absent, the two images appear correctly, as expected from the GFM specification (images are inlines). The result from the caption should at least not break anything. In my opinion, we should get two images under the same figure mark (hence treating the caption as a container block, with two inlines in it).

However this problem is easily mitigated by adding a line break between the two images, which would result in the two images treated as two different figures, one of the two having a default caption (which can also be changed using Figure:). This is also why I think the behavior should not be this one if the two images are not separated by a line break.