mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
Avoid hardcoding embed script filenames
This commit is contained in:
@@ -168,7 +168,7 @@ function initTurndownService() {
|
||||
replacement: (content, node) => {
|
||||
let before = '\n\n';
|
||||
let src = node.getAttribute('src');
|
||||
if (src.endsWith('twitter.com/widgets.js') || src.endsWith('codepen.io/assets/embed/ei.js')) {
|
||||
if (node.previousSibling && node.previousSibling.nodeName !== '#text') {
|
||||
// keep twitter and codepen <script> tags snug with the element above them
|
||||
before = '\n';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user