From be5cab65d26ddfd0e71bb34ecfc689b7d4cbf508 Mon Sep 17 00:00:00 2001 From: poire-z Date: Sun, 29 Dec 2024 23:04:57 +0100 Subject: [PATCH] Wikipedia EPUBs: fix missing symbols at start of headings (#12961) Wikipedia has changed their HTML output from:

Stuff

to:

Stuff

--- frontend/ui/wikipedia.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/ui/wikipedia.lua b/frontend/ui/wikipedia.lua index b7ccf886c..a94bb7381 100644 --- a/frontend/ui/wikipedia.lua +++ b/frontend/ui/wikipedia.lua @@ -1453,12 +1453,12 @@ abbr.abbr { if self.wiki_prettify then -- Prepend some symbols to section titles for a better visual feeling of hierarchy - html = html:gsub("

", "

"..h1_sym.." ") - html = html:gsub("

", "

"..h2_sym.." ") - html = html:gsub("

", "

"..h3_sym.." ") - html = html:gsub("

", "

"..h4_sym.." ") - html = html:gsub("

", "
"..h5_sym.." ") - html = html:gsub("
", "
"..h6_sym.." ") + html = html:gsub("(]*>)", "%1 "..h1_sym.." ") + html = html:gsub("(]*>)", "%1 "..h2_sym.." ") + html = html:gsub("(]*>)", "%1 "..h3_sym.." ") + html = html:gsub("(]*>)", "%1 "..h4_sym.." ") + html = html:gsub("(]*>)", "%1 "..h5_sym.." ") + html = html:gsub("(]*>)", "%1 "..h6_sym.." ") end -- Note: in all the gsub patterns above, we used lowercase for tags and attributes