Wikipedia EPUBs: fix missing symbols at start of headings (#12961)
Some checks failed
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Has been cancelled
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Has been cancelled

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
2024-12-29 23:04:57 +01:00
committed by GitHub
parent b8af072d9f
commit be5cab65d2

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