Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

summary and details tag are no longer supported #1915

Open
VadimKovalenkoSNF opened this issue Sep 22, 2023 · 3 comments
Open

summary and details tag are no longer supported #1915

VadimKovalenkoSNF opened this issue Sep 22, 2023 · 3 comments
Assignees
Milestone

Comments

@VadimKovalenkoSNF
Copy link
Collaborator

Before mobile-section deprecation mwoffliner used related JSON response to generate collapsible sections using Swig templates (see res/templates/section_wrapper.html file). Since page/html and page/mobile-html are responsible for outputting HTML content, no collapse sections are available. The symptom of this issue is mentioned in #1860 and #1866

There are multiple ways to bring these sections to work:

  1. Apply page/html output and related transformations from mobileapps in mwoffliner.
  2. Create our own collapsible sections but on top of page/mobile-html
@Jaifroid
Copy link
Collaborator

Jaifroid commented Oct 10, 2023

@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:

  • Replace the <section data-mw-section-id="...">...</section> blocks with <details data-mw-section-id="...">...</details>;
  • Wrap* (not replace) the <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.

@VadimKovalenkoSNF
Copy link
Collaborator Author

Thanks, @Jaifroid . I'll probably use DOM methods for this indeed, but your idea seems valid.

@kelson42
Copy link
Collaborator

Postponing, not even sure this is a problem.

@kelson42 kelson42 modified the milestones: 1.14.0, 1.15.0 Dec 12, 2024
@kelson42 kelson42 self-assigned this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants