added filter for medium images
parent
9290e3c853
commit
86efeb7fee
|
@ -15,6 +15,15 @@ module.exports = {
|
||||||
/\*\*\[\^\]\(#cite_ref[^\)]+\)\*\*/g,
|
/\*\*\[\^\]\(#cite_ref[^\)]+\)\*\*/g,
|
||||||
/(?:\\\[)?\[edit\]\([^\s]+\s+"[^"]+"\)(?:\\\])?/ig
|
/(?:\\\[)?\[edit\]\([^\s]+\s+"[^"]+"\)(?:\\\])?/ig
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
domain: /(?:.*\.)?medium\.com/,
|
||||||
|
replace: [
|
||||||
|
{
|
||||||
|
find: '(https://miro.medium.com/max/60/',
|
||||||
|
replacement: '(https://miro.medium.com/max/600/'
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -22,8 +31,16 @@ module.exports = {
|
||||||
let domain = urlparser.parse(url).hostname
|
let domain = urlparser.parse(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)) {
|
||||||
for (let j=0;j<this.list[i].remove.length; j++) {
|
if (this.list[i].remove) {
|
||||||
data = data.replace(this.list[i].remove[j],"");
|
for (let j=0;j<this.list[i].remove.length; j++) {
|
||||||
|
data = data.replaceAll(this.list[i].remove[j],"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.list[i].replace) {
|
||||||
|
for (let j=0;j<this.list[i].replace.length; j++) {
|
||||||
|
data = data.replaceAll(this.list[i].replace[j].find,
|
||||||
|
this.list[i].replace[j].replacement);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue