bump crengine: new HTML parser, libRu and FB2 tweaks (#6560)

Includes:
- Revert "FB2: don't draw cover in scroll mode"
- (Upstream) FB2: fix coverpage drawing in scroll mode
- FB2 footnotes: only merge run-in when next is erm_final
- fb2.css: use OTF tabular-nums for footnote numbers
- Text: ignore ascii and unicode control chars
- Fix HR positionning when floats involved
- writeNodeEx(): minor tweaks
- OnTagClose(): add self_closing_tag parameter
- HTML format detection: accept HTML5 doctype
- HTML parser: rework Lib.ru specific handling
- HTML parser: new more conforming implementation
- HTML parser: ensure foster parenting inside tables

Also includes:
- SDL: don't bypass X11 WM compositor
reviewable/pr6563/r1
poire-z 4 years ago committed by GitHub
parent 66e8087c66
commit 8d99523388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1 +1 @@
Subproject commit 7b05d5a73980f852290e3f10e6078cc88162bbea
Subproject commit 9ba142825282b44446d09985669022ac9e3ba64e

@ -1203,6 +1203,12 @@ function ReaderRolling:checkXPointersAndProposeDOMVersionUpgrade()
-- Set latest DOM version, to be used at next load
local latest_dom_version = self.ui.document:getLatestDomVersion()
-- For some formats, DOM version 20200824 uses a new HTML parser that may build
-- a different DOM tree. So, migrate these to a lower version
local doc_format = self.ui.document:getDocumentFormat()
if doc_format == "HTML" or doc_format == "CHM" or doc_format == "PDB" then
latest_dom_version = self.ui.document:getDomVersionWithNormalizedXPointers()
end
self.ui.doc_settings:saveSetting("cre_dom_version", latest_dom_version)
logger.info(" cre_dom_version updated to", latest_dom_version)

@ -53,6 +53,7 @@ local ReaderZooming = require("apps/reader/modules/readerzooming")
local Screenshoter = require("ui/widget/screenshoter")
local SettingsMigration = require("ui/data/settings_migration")
local UIManager = require("ui/uimanager")
local ffiUtil = require("ffi/util")
local lfs = require("libs/libkoreader-lfs")
local logger = require("logger")
local util = require("util")
@ -270,15 +271,22 @@ function ReaderUI:init()
end
-- make sure we render document first before calling any callback
self:registerPostInitCallback(function()
local start_ts = ffiUtil.getTimestamp()
if not self.document:loadDocument() then
self:dealWithLoadDocumentFailure()
end
logger.dbg(string.format(" loading took %.3f seconds", ffiUtil.getDuration(start_ts)))
-- used to read additional settings after the document has been
-- loaded (but not rendered yet)
self:handleEvent(Event:new("PreRenderDocument", self.doc_settings))
start_ts = ffiUtil.getTimestamp()
self.document:render()
logger.dbg(string.format(" rendering took %.3f seconds", ffiUtil.getDuration(start_ts)))
-- Uncomment to output the built DOM (for debugging)
-- logger.dbg(self.document:getHTMLFromXPointer(".0", 0x6830))
end)
-- styletweak controller (must be before typeset controller)
self:registerModule("styletweak", ReaderStyleTweak:new{

@ -180,6 +180,10 @@ function CreDocument:requestDomVersion(version)
cre.requestDomVersion(version)
end
function CreDocument:getDocumentFormat()
return self._document:getDocumentFormat()
end
function CreDocument:setupDefaultView()
if self.loaded then
-- Don't apply defaults if the document has already been loaded

Loading…
Cancel
Save