mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 14:40:23 +08:00
refactor: replace re2 with re2-wasm (#12998)
* refactor: replace re2 with re2-wasm * refactor: remove migrated routes * ci: remove foresight https://github.com/runforesight Foresight is no longer in service * fix: add back removed wasm chore: bump base OS image
This commit is contained in:
@@ -3,7 +3,7 @@ const cheerio = require('cheerio');
|
||||
const { simplecc } = require('simplecc-wasm');
|
||||
const got = require('@/utils/got');
|
||||
const config = require('@/config').value;
|
||||
const RE2 = require('re2');
|
||||
const { RE2 } = require('re2-wasm');
|
||||
|
||||
let mercury_parser;
|
||||
|
||||
@@ -167,7 +167,7 @@ module.exports = async (ctx, next) => {
|
||||
case 'regexp':
|
||||
return new RegExp(string, 'i');
|
||||
case 're2':
|
||||
return new RE2(string, 'i');
|
||||
return new RE2(string, 'iu');
|
||||
default:
|
||||
throw Error(`Invalid Engine Value: ${engine}, please check your config.`);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ module.exports = async (ctx, next) => {
|
||||
case 'regexp':
|
||||
return new RegExp(string);
|
||||
case 're2':
|
||||
return new RE2(string);
|
||||
return new RE2(string, 'u');
|
||||
default:
|
||||
throw Error(`Invalid Engine Value: ${engine}, please check your config.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user