You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current tests expect that sections and details will be removed if they have only summary tag inside without empty paragraph inside. The option keepEmptyParagraphs is responsible for removing these elements. The source code of it is:
/* Remove empty paragraphs */
if (!dump.opts.keepEmptyParagraphs) {
// Mobile view === details
// Desktop view === section
const sections: DominoElement[] = Array.from(parsoidDoc.querySelectorAll('details, section'))
for (const section of sections) {
if (
section.children.length ===
Array.from(section.children).filter((child: DominoElement) => {
return child.matches('summary')
}).length
) {
DU.deleteNode(section)
}
}
}
After transformation, the first section and details elements will be removed, as they only contain summary children. So the final output will look like this:
Current Parsoid version doesn't have the support of details tags (see https://phabricator.wikimedia.org/T31118) so keepEmptyParagraphs should be refactored with related unit tests since we expect to use page/html and page/mobile-html for desktop and mobile view respectively.
The text was updated successfully, but these errors were encountered:
Upd: conversion to <details> and <sections> requires mobile-section endpoint working and happens in mwoffliner using res/templates/subsection_wrapper.html swig template.
Current tests expect that sections and details will be removed if they have only summary tag inside without empty paragraph inside. The option
keepEmptyParagraphs
is responsible for removing these elements. The source code of it is:Consider this HTML is an example:
After transformation, the first section and details elements will be removed, as they only contain summary children. So the final output will look like this:
Current Parsoid version doesn't have the support of details tags (see https://phabricator.wikimedia.org/T31118) so
keepEmptyParagraphs
should be refactored with related unit tests since we expect to use page/html and page/mobile-html for desktop and mobile view respectively.The text was updated successfully, but these errors were encountered: