Download file:
Sometimes I'm stuck with a project crammed with inline styling. The following script will quickly strip all inline styling from your project.
To use this script, download the script and import the script in the Script Explorer. There are three settings in the top of the file:
- Define whether you use source control or not. If you use source control, uncomment
var SourceControl = true;and commentvar SourceControl = false;. If you don't use source control, the script is already correctly configured. - Define whether you want to retain borders of images. RoboHelp normally hides the border for images. Setting
var RetainImageBorders = false;removes the border settings. Settingvar RetainImageBorders = true;leaves border settings. - Set protected elements. Sometimes you want to retain inline styling, such as a style block in a topic. You can set the attribute and value that protected elements have.
Example for setting protected elements:
var SafeAttr = new Array(); SafeAttr['attribute'] = 'rel'; SafeAttr['value'] = 'protected';
This will not clean elements with the attribute rel that have the value protected.
When the script is set, open your project and run the script.
Note: Always make a backup of your project before running a script! This script is provided as-is, without warranty of any kind.
Revision history
| Version | Note |
|---|---|
| 20110915 | Minor fix. |
| 20101230 | Added option to retain borders around images. Many thanks to Derek Fosberry for pointing you probably want to retain the border settings for images. |
| 20101218 | Original version |
