feat(novelsbr): add Novels BR plugin and icon - #2624
felipebonfim2006 wants to merge 2 commits into
Conversation
|
| const paragraphs = content | ||
| .find('p') | ||
| .map((_, element) => $(element).html()?.trim() || '') | ||
| .get() | ||
| .filter(Boolean); | ||
|
|
||
| return paragraphs.length > 0 | ||
| ? paragraphs.join('<br><br>') | ||
| : content.html()?.trim() || ''; |
There was a problem hiding this comment.
Chapter code can run.
parseChapter removes some tags but leaves attributes such as onerror on images. If a fetched chapter contains <img src=x onerror=...>, that attribute remains in the returned HTML. The reader inserts that HTML into the page, where the handler can run. Strip active attributes before returning the chapter.
How this was verified: Fetched chapter HTML keeps image event attributes, and the reader inserts the returned string with dangerouslySetInnerHTML.
| const params = new URLSearchParams(); | ||
|
|
||
| params.set('simplifiedField', ''); | ||
|
|
||
| if (category) { | ||
| params.set('categoryId', category); | ||
| } | ||
|
|
||
| params.set('page', String(Math.max(0, pageNo - 1))); | ||
|
|
||
| const body = await fetchText(`${this.site}/novels?${params.toString()}`); |
There was a problem hiding this comment.
| content | ||
| .find( | ||
| 'script, style, noscript, iframe, ins, .adsbygoogle, button, .navigation-buttons, a', | ||
| ) | ||
| .remove(); |
There was a problem hiding this comment.
Closes #1570
type(scope): description