fix: Update Rewayat Club (#1833)
- improve chapter text formatting (#1753) - fix error on search
This commit is contained in:
@@ -7,12 +7,13 @@ import { defaultCover } from '@libs/defaultCover';
|
|||||||
class RewayatClub implements Plugin.PagePlugin {
|
class RewayatClub implements Plugin.PagePlugin {
|
||||||
id = 'rewayatclub';
|
id = 'rewayatclub';
|
||||||
name = 'Rewayat Club';
|
name = 'Rewayat Club';
|
||||||
version = '1.0.1';
|
version = '1.0.2';
|
||||||
icon = 'src/ar/rewayatclub/icon.png';
|
icon = 'src/ar/rewayatclub/icon.png';
|
||||||
site = 'https://rewayat.club/';
|
site = 'https://rewayat.club/';
|
||||||
|
|
||||||
parseNovels(data: NovelData): Plugin.NovelItem[] {
|
parseNovels(data: NovelData): Plugin.NovelItem[] {
|
||||||
const novels: Plugin.NovelItem[] = [];
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
if (data.results === undefined) return novels;
|
||||||
data.results.map((item: NovelEntry) => {
|
data.results.map((item: NovelEntry) => {
|
||||||
novels.push({
|
novels.push({
|
||||||
name: item.arabic || item.novel?.arabic || 'novel',
|
name: item.arabic || item.novel?.arabic || 'novel',
|
||||||
@@ -144,8 +145,9 @@ class RewayatClub implements Plugin.PagePlugin {
|
|||||||
const result = await fetchApi(link).then(r => r.json());
|
const result = await fetchApi(link).then(r => r.json());
|
||||||
let chapterText = result.content
|
let chapterText = result.content
|
||||||
.flat()
|
.flat()
|
||||||
.join('')
|
.join('<br>')
|
||||||
.replace(/<p>\n|\n<p>\n/g, '');
|
.replace(/\n/g, '')
|
||||||
|
.replace(/<p>/g, '\n');
|
||||||
chapterText = chapterText.trim();
|
chapterText = chapterText.trim();
|
||||||
return chapterText;
|
return chapterText;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user