thephpleague / html-to-markdown

Convert HTML to Markdown with PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to keep img tags inside figures?

caraya opened this issue · comments

I'm working with WordPress content that uses figure elements. When I convert it to markdown, it produces the following result:

<figure> ![](https://publishing-project.rivendellweb.net/wp-content/uploads/2023/05/small-viewport.png)<figcaption>Small viewport show in light g
reen color. The image shows the browser address bar at the top and the browser navigation bar at the bottom. Source: [Interop 2022](https://githu
b.com/web-platform-tests/interop-2022-viewport/blob/main/explainers/viewport-units.md)</figcaption></figure>

I would like the library not to convert the image tag to markdown, but only when it's inside a figure.

Is this possible?