See: Description
Class | Description |
---|---|
Tabby |
Replace tabs with spaces.
|
The task is to replace tabs with spaces and preserve any indentaion that was a combination of tabs and spaces. This means honouring the 'tab stops' that would be used by an editor and not just a global search and replace.
The mechanism used is to keep track of the character offset from the beginning of a line and when a tab is encountered add spaces till the next tab stop.
At the same time any "\r\n" combinations that are in the file are converted to simple "\n" characters as found on Unix/Linux systems, and trailing whitespace at the ends of lines is removed.
The trick is to only write the file if something in the file required changes,
so a boolean variable is kept current with a true
value indicating
the file needs to be modified.
HTML Parser is an open source library released under LGPL.