Avoid hardcoding embed script filenames

This commit is contained in:
Will Boyd
2018-11-15 15:15:34 -05:00
parent 882222ff19
commit 9307066570
+1 -1
View File
@@ -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';
}