mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
Fix enlighter rule selector
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ function initTurndownService() {
|
||||
|
||||
// preserve enlighter code blocks
|
||||
turndownService.addRule('enlighter', {
|
||||
filter: node => node.nodeName === 'PRE' && node.getAttribute('class') === 'EnlighterJSRAW',
|
||||
filter: (node) => node.nodeName === 'PRE' && node.classList.contains('EnlighterJSRAW'),
|
||||
replacement: (content, node) => {
|
||||
const language = node.getAttribute('data-enlighter-language') ?? '';
|
||||
return '\n' + '```' + language + '\n' + content + '\n' + '```' + '\n';
|
||||
|
||||
Reference in New Issue
Block a user