Skip to content

Wrapper DIV Remover

Chris Bohnert edited this page Oct 28, 2022 · 1 revision

Wrapper DIV Remover

Overview

This document provides information about how wrapper DIV remover utility works and what its expected behavior is.

Technical details

The Wrapper DIV remover class is WrapperDivRemover. It is a simple utility class that can remove user selected HTML DIVs from the output HTML.

It exposes a single public methods, which is removeWrapperDivs: takes the Document and an array of wrapper DIV classes to be removed, and returns nothing. Its execution consist in navigating the Document nodes tree and, for each element, it checks if it is a DIV and it has one of the specified CSS classes: if so, it removes it and adds to the parent node all of its children.

Its execution is embedded in StylesInlinerServiceImpl, and its execution could be configured by the OSGI configuration named "Styles inliner configuration": here the user can insert which CSS classes can be removed from the output HTML.

Tests and coverage

The class WrapperDivRemoverTest is the JUnit test class. Tests that cover the features required for this utility are defined here. The code coverage (retrieved from Intellij Idea Coverage window) is:

  1. Class: 100%
  2. Method: 100%
  3. Lines: 90%