lonekorean / wordpress-export-to-markdown

Converts a WordPress export XML file into Markdown files.
MIT License
1.07k stars 216 forks source link

Preserve <figure> and <figcaption> #107

Closed lonekorean closed 6 months ago

lonekorean commented 6 months ago

Gutenberg WordPress wraps images in <figure> by default. My concern was that most people probably just want the image and not the extra markup noise that comes with <figure>.

So I preserve <figure> only when there is a <figcaption> within.

That way folks purposefully using <figure> + <figcaption> will have their markup preserved. Others will get the simple image markdown.

If there is demand for more nuance/control, then adding a flag to settings.js can be considered.

lonekorean commented 6 months ago

Fixes https://github.com/lonekorean/wordpress-export-to-markdown/issues/94