Fix special characters breaking search in most sources (#1557)
This commit is contained in:
@@ -42,7 +42,7 @@ class LightNovelWPPlugin implements Plugin.PluginBase {
|
||||
this.icon = `multisrc/lightnovelwp/${metadata.id.toLowerCase()}/icon.png`;
|
||||
this.site = metadata.sourceSite;
|
||||
const versionIncrements = metadata.options?.versionIncrements || 0;
|
||||
this.version = `1.1.${6 + versionIncrements}`;
|
||||
this.version = `1.1.${7 + versionIncrements}`;
|
||||
this.options = metadata.options ?? ({} as LightNovelWPOptions);
|
||||
this.filters = metadata.filters satisfies Filters;
|
||||
|
||||
@@ -103,7 +103,9 @@ class LightNovelWPPlugin implements Plugin.PluginBase {
|
||||
|
||||
if (novelName && novelUrl) {
|
||||
const novelCover =
|
||||
article.match(/<img [^>]*?src="([^\"]*)"[^>]*?(?: data-src="([^\"]*)")?[^>]*>/) || [];
|
||||
article.match(
|
||||
/<img [^>]*?src="([^\"]*)"[^>]*?(?: data-src="([^\"]*)")?[^>]*>/,
|
||||
) || [];
|
||||
|
||||
let novelPath;
|
||||
if (novelUrl.includes(this.site)) {
|
||||
@@ -444,7 +446,8 @@ class LightNovelWPPlugin implements Plugin.PluginBase {
|
||||
searchTerm: string,
|
||||
page: number,
|
||||
): Promise<Plugin.NovelItem[]> {
|
||||
const url = this.site + 'page/' + page + '/?s=' + searchTerm;
|
||||
const url =
|
||||
this.site + 'page/' + page + '/?s=' + encodeURIComponent(searchTerm);
|
||||
const html = await this.safeFecth(url, true);
|
||||
return this.parseNovels(html);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user