Skip to content

MuPDF: add getBalancedHTML function using story - #2322

Draft
Frenzie wants to merge 7 commits into
koreader:masterfrom
Frenzie:mupdf-getbalancedhtml
Draft

MuPDF: add getBalancedHTML function using story#2322
Frenzie wants to merge 7 commits into
koreader:masterfrom
Frenzie:mupdf-getbalancedhtml

Conversation

@Frenzie

@Frenzie Frenzie commented Apr 1, 2026

Copy link
Copy Markdown
Member

A second attempt at #2060 that actually works.

For example,

<html><body><p>one<div>two</body></html>
<?xml version="1.0" encoding="UTF-8" ?><html><head/><body><p>one</p><div>two</div></body></html>

<html><body><ul><li>a<li>b</ul></body></html>
<?xml version="1.0" encoding="UTF-8" ?><html><head/><body><ul><li>a</li><li>b</li></ul></body></html>

This change is Reviewable

Frenzie added 6 commits April 17, 2026 19:59
…izes tab and space as entities.

Fix by undoing that…

Test using something like:

./luajit -e 'dofile("setupkoenv.lua"); local M=require("ffi/mupdf"); local samples={[[<span> Liberate your OpenClaw 🦀 </span>]], [[<html><head><meta charset="utf-8"></head><body><span> Liberate your OpenClaw 🦀 </span></body></html>]]}; for i,s in ipairs(samples) do local out,err=M.getBalancedHTML(s); if not out then error(err) end; print("---"..i.."---"); print(out); end'
@Frenzie Frenzie mentioned this pull request May 17, 2026
@Frenzie
Frenzie force-pushed the mupdf-getbalancedhtml branch from 2221528 to 7bd5786 Compare May 19, 2026 19:56
@Frenzie
Frenzie force-pushed the mupdf-getbalancedhtml branch from 7bd5786 to a075755 Compare May 19, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant