mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
Fix missing newline in merging of sublists
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/736
Regression from:
- e27328f931
This commit is contained in:
parent
978f04219a
commit
d6ccc9857d
1 changed files with 8 additions and 5 deletions
|
@ -236,10 +236,11 @@ api.fetchFilterList = async function(mainlistURL) {
|
||||||
const out = [];
|
const out = [];
|
||||||
const reInclude = /^!#include +(\S+)/gm;
|
const reInclude = /^!#include +(\S+)/gm;
|
||||||
for ( const result of results ) {
|
for ( const result of results ) {
|
||||||
if ( result instanceof Object === false ) {
|
if ( typeof result === 'string' ) {
|
||||||
out.push(result);
|
out.push(result);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ( result instanceof Object === false ) { continue; }
|
||||||
const content = result.content;
|
const content = result.content;
|
||||||
let lastIndex = 0;
|
let lastIndex = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -256,10 +257,10 @@ api.fetchFilterList = async function(mainlistURL) {
|
||||||
if ( sublistURLs.has(subURL.href) ) { continue; }
|
if ( sublistURLs.has(subURL.href) ) { continue; }
|
||||||
sublistURLs.add(subURL.href);
|
sublistURLs.add(subURL.href);
|
||||||
out.push(
|
out.push(
|
||||||
content.slice(lastIndex, match.index).trim(),
|
content.slice(lastIndex, match.index),
|
||||||
`\n! >>>>>>>> ${subURL.href}\n`,
|
`! >>>>>>>> ${subURL.href}`,
|
||||||
api.fetchText(subURL.href),
|
api.fetchText(subURL.href),
|
||||||
`! <<<<<<<< ${subURL.href}\n`
|
`! <<<<<<<< ${subURL.href}`
|
||||||
);
|
);
|
||||||
lastIndex = reInclude.lastIndex;
|
lastIndex = reInclude.lastIndex;
|
||||||
}
|
}
|
||||||
|
@ -282,7 +283,9 @@ api.fetchFilterList = async function(mainlistURL) {
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
url: mainlistURL,
|
url: mainlistURL,
|
||||||
content: allParts.join('')
|
content: allParts.length === 1
|
||||||
|
? allParts[0]
|
||||||
|
: allParts.map(s => s.trim()).filter(s => s !== '').join('\n')
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue