User:Derugon/Sandbox/Help:DLC Switcher

The DLC switcher is an experimental gadget, analyzing the DLC icons on a page to remove all information unrelated to a specific version of the game. It it disabled by default, but can be activated on the Gadgets tab of the user Preferences.

Rules
The gadget follows some rules to analyze what a DLC icon is for. Here are the rules followed when a DLC icon is picked for a specific game version. If a matching case is found, the program stops, then analyzes the next DLC icon.
 * 1) If the DLC icon matches with the game version:
 * 2) * Removes the DLC icon without modifying the page content.
 * 3) If the parent container is a DLC context box (has the .context-box class):
 * 4) If there is a header before the DLC context box:
 * 5) * Removes the entire section and its sub-sections.
 * 6) Otherwise:
 * 7) * Clears the entire page.
 * 8) If there is no raw text directly before the DLC icon in its container:
 * 9) If there is no raw text or HTML element before the DLC icon in its container:
 * 10) If the container is a table cell ():
 * 11) If the table cell is the first one of the row:
 * 12) * Removes the table row.
 * 13) Otherwise:
 * 14) * Empties the table cell.
 * 15) Otherwise:
 * 16) * Removes the container.
 * 17) If the previous HTML element is a line break ():
 * 18) * Removes all following elements until the next line break or the end of the container.
 * 19) Otherwise:
 * 20) * Does nothing, the DLC icon is left on the page to help detecting it. Either the gadget should be changed to take this case into account, or the article should be modified to match one of the previous cases.