diff --git a/url_to_markdown_common_filters.js b/url_to_markdown_common_filters.js index 175cc85..8422088 100755 --- a/url_to_markdown_common_filters.js +++ b/url_to_markdown_common_filters.js @@ -31,7 +31,7 @@ module.exports = { find: /\n(.+)\n\-{32,}\n/ig, replacement: (match, title) => { return '\n'+title+'\n'+'-'.repeat(title.length)+'\n' - } + } } ] @@ -43,6 +43,12 @@ module.exports = { find: '(https://miro.medium.com/max/60/', replacement: '(https://miro.medium.com/max/600/' } + ], + replace: [ + { + find: /\s*\[\s*!\[([^\]]+)\]\(([^\)]+)\)\s*\]\((https:\/\/medium.com\/@[^\?\)]*)\?[^\)]*\)\s*/g, + replacement: '![$1]($2)\n[$1]($3)\n\n' + } ] }, { @@ -51,7 +57,7 @@ module.exports = { /\* +Links(.|\r|\n)*Three +\|/g ] } - ], + ], filter: function (url, data, ignore_links=false) { let domain=''; @@ -60,10 +66,10 @@ module.exports = { url = new URL(url); if (url) { base_address = url.protocol+"//"+url.hostname; - domain = url.hostname; + domain = url.hostname; } } - + for (let i=0;i