Open VadimKovalenkoSNF opened 11 months ago
@VadimKovalenkoSNF I'm not quite sure how substitution happens in mwOffliner, but I've found that the following two steps easily restore the previous behaviour:
<section data-mw-section-id="...">...</section>
blocks with <details data-mw-section-id="...">...</details>
;<h[2-5]>...</h>
blocks inside the new <details>
blocks with <summary class="section-heading collapsible-heading">...</summary>
.I can provide a one-line regular expression JS replacement that does this if you operate on the html as a string, though I suspect you might prefer to use DOM methods to select and replace/wrap the elements.
I have a working solution in prototype code for the Kiwix JS PWA, but it would be much better to fix in the ZIM. Happy to give details if it's helpful.
Thanks, @Jaifroid . I'll probably use DOM methods for this indeed, but your idea seems valid.
Before
mobile-section
deprecation mwoffliner used related JSON response to generate collapsible sections using Swig templates (see res/templates/section_wrapper.html file). Sincepage/html
andpage/mobile-html
are responsible for outputting HTML content, no collapse sections are available. The symptom of this issue is mentioned in https://github.com/openzim/mwoffliner/issues/1860 and https://github.com/openzim/mwoffliner/issues/1866There are multiple ways to bring these sections to work:
page/html
output and related transformations from mobileapps in mwoffliner.page/mobile-html