Skip to content

[plugin] NewsDownloader: reduce HTML idiosyncracies#12976

Merged
Frenzie merged 1 commit into
koreader:masterfrom
Frenzie:newsdownload-html
Jan 2, 2025
Merged

[plugin] NewsDownloader: reduce HTML idiosyncracies#12976
Frenzie merged 1 commit into
koreader:masterfrom
Frenzie:newsdownload-html

Conversation

@Frenzie

@Frenzie Frenzie commented Jan 1, 2025

Copy link
Copy Markdown
Member

Noticed in #12969 (comment)

This merely makes it a touch friendlier to future changes. Fixing it up as "proper" XHTML is likely to do more harm than good, since the content will typically be regular HTML encapsulated in <![CDATA[.


This change is Reviewable

@Frenzie Frenzie added the Plugin label Jan 1, 2025
@Frenzie Frenzie added this to the 2025.01 milestone Jan 1, 2025
@poire-z

poire-z commented Jan 1, 2025

Copy link
Copy Markdown
Contributor

I don't notice much change, just 'UTF-8' changed to "UTF-8", and some newlines added.
It seems it doesn't fix any of these complains in your snippet output:

content.html(-1,-1): Irregular DOCTYPE: found "", expected "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">".
content.html(2,7): Error while parsing file: elements from namespace "" are not allowed
content.html(3,109): Fatal Error while parsing file: The element type "meta" must be terminated by the matching end-tag "</meta>".
content.html(-1,-1): Error while parsing file: The element type "meta" must be terminated by the matching end-tag "</meta>".
content.html(2,7): Html element does not have an xmlns set to "http://www.w3.org/1999/xhtml".

or am I just missing your aim (just the newlines so the (3,109) can more easily be located?)?

@Frenzie

Frenzie commented Jan 1, 2025

Copy link
Copy Markdown
Member Author

Actually my primary goal is to change h2 to h1, secondary goal to add a few newlines. And indeed, I don't want to pretend it's valid XHTML when it's not. Though granted, in rare cases without CDATA it could be. I know of one example on https://annevankesteren.nl/feeds/weblog.

@Frenzie Frenzie merged commit 10f627e into koreader:master Jan 2, 2025
@Frenzie Frenzie deleted the newsdownload-html branch January 2, 2025 11:42
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants