lonekorean / wordpress-export-to-markdown

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

<pre> code blocks #108

Closed lonekorean closed 6 months ago

lonekorean commented 6 months ago

Context: there are several ways to create a code block. A <pre> with a <code> within is common. Some WordPress plugins though will use a <pre> without a <code> (syntaxhighlighter and enlighter are two that were reported).

This PR consolidates these cases in a way that results in a markdown code block (triple backticks). The code language is also applied when provided in a WordPress HTML comment above the block.

lonekorean commented 6 months ago

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

Cherry picks https://github.com/lonekorean/wordpress-export-to-markdown/pull/100 and https://github.com/lonekorean/wordpress-export-to-markdown/pull/77.