Skip to content
This repository was archived by the owner on Nov 20, 2021. It is now read-only.

Commit b567eec

Browse files
committed
Decode entities
1 parent 3b48a43 commit b567eec

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

‎src/RainOfSnow/RainOfSnow.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const BASE = "https://rainofsnow.com"
1515

1616
export const RainOfSnowInfo: SourceInfo = {
1717
icon: "icon.png",
18-
version: "1.3.1",
18+
version: "1.3.2",
1919
name: "RainOfSnow",
2020
author: "PythonCoderAS",
2121
authorWebsite: "https://github.com/PythonCoderAS",

‎src/RainOfSnow/RainOfSnowParser.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import {Chapter, LanguageCode, Manga, MangaStatus, MangaTile, Tag} from "paperba
22

33
export class RainOfSnowParser {
44

5+
decodeHTMLEntity(str: string): string {
6+
return str.replace(/&#(\d+);/g, function (match, dec) {
7+
return String.fromCharCode(dec);
8+
})
9+
}
10+
511
parseMangaList($: CheerioStatic, base: string, filterElement: Cheerio | null = null) {
612
if (filterElement === null){
713
filterElement = $.root()
@@ -73,13 +79,13 @@ export class RainOfSnowParser {
7379
}))
7480
const chapterList = this.parseChapterList($, mangaId, base)
7581
const mangaObj: Manga = {
76-
author: $("small", $("ul.vbtcolor1 li").first()).text().trim(),
82+
author: this.decodeHTMLEntity($("small", $("ul.vbtcolor1 li").first()).text().trim()),
7783
desc: summary,
7884
id: mangaId,
7985
image: $("img", $("div.container div.row").first()).first().attr("src") || "",
8086
rating: 0,
8187
status: MangaStatus.ONGOING,
82-
titles: [$("div.text h2").first().text()],
88+
titles: [this.decodeHTMLEntity($("div.text h2").first().text())],
8389
tags: [createTagSection({
8490
id: "1",
8591
label: "1",

0 commit comments

Comments
 (0)