Neaten Medium avatar

main
Lee Hanken 2024-07-12 12:25:41 +01:00
parent f7bc315a79
commit 69598b11ab
1 changed files with 10 additions and 4 deletions

View File

@ -31,7 +31,7 @@ module.exports = {
find: /\n(.+)\n\-{32,}\n/ig, find: /\n(.+)\n\-{32,}\n/ig,
replacement: (match, title) => { replacement: (match, title) => {
return '\n'+title+'\n'+'-'.repeat(title.length)+'\n' return '\n'+title+'\n'+'-'.repeat(title.length)+'\n'
} }
} }
] ]
@ -43,6 +43,12 @@ module.exports = {
find: '(https://miro.medium.com/max/60/', find: '(https://miro.medium.com/max/60/',
replacement: '(https://miro.medium.com/max/600/' 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 /\* +Links(.|\r|\n)*Three +\|/g
] ]
} }
], ],
filter: function (url, data, ignore_links=false) { filter: function (url, data, ignore_links=false) {
let domain=''; let domain='';
@ -60,10 +66,10 @@ module.exports = {
url = new URL(url); url = new URL(url);
if (url) { if (url) {
base_address = url.protocol+"//"+url.hostname; base_address = url.protocol+"//"+url.hostname;
domain = url.hostname; domain = url.hostname;
} }
} }
for (let i=0;i<this.list.length;i++) { for (let i=0;i<this.list.length;i++) {
if (domain.match(this.list[i].domain)) { if (domain.match(this.list[i].domain)) {
if (this.list[i].remove) { if (this.list[i].remove) {