Wikipedia EPUBs: fix missing symbols at start of headings (#12961)

Wikipedia has changed their HTML output from:
  <h2> <span class="mw-headline" id="stuff">Stuff</span></h2>
to:
  <h2 id="stuff">Stuff</h2>
This commit is contained in:
poire-z authored and GitHub committed 2024-12-29 23:04:57 +01:00
1 parent b8af072d9f
commit be5cab65d2
1 file changed
+6 -6
+6 -6
View File
@@ -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>", "<h1> "..h1_sym.." ")
html = html:gsub("<h2>", "<h2> "..h2_sym.." ")
html = html:gsub("<h3>", "<h3> "..h3_sym.." ")
html = html:gsub("<h4>", "<h4> "..h4_sym.." ")
html = html:gsub("<h5>", "<h5> "..h5_sym.." ")
html = html:gsub("<h6>", "<h6> "..h6_sym.." ")
html = html:gsub("(<h1[^>]*>)", "%1 "..h1_sym.." ")
html = html:gsub("(<h2[^>]*>)", "%1 "..h2_sym.." ")
html = html:gsub("(<h3[^>]*>)", "%1 "..h3_sym.." ")
html = html:gsub("(<h4[^>]*>)", "%1 "..h4_sym.." ")
html = html:gsub("(<h5[^>]*>)", "%1 "..h5_sym.." ")
html = html:gsub("(<h6[^>]*>)", "%1 "..h6_sym.." ")
end
-- Note: in all the gsub patterns above, we used lowercase for tags and attributes