| 1 |
Readme |
Readme |
| 2 |
------ |
------ |
| 3 |
|
|
| 4 |
This is an HTML correcting module. The filter completely scans the input, |
This is an HTML correcting module. The filter scans the input and makes sure |
| 5 |
builds up a list of open tags and closes them when needed. Features: |
all HTML tags are properly nested and closed. |
| 6 |
|
|
| 7 |
- Correct the HTML so that a valid tree-structure is formed. |
Note: The filter only checks against basic syntax, not against the HTML |
| 8 |
- Smart-close certain tags that are still used without closing tags by |
specification. Non-existant tags or entities will pass as correct. |
|
some people: "<p>text<p>text" gets transformed into "<p>text</p><p>text</p>" |
|
|
instead of "<p>text<p>text</p></p>". |
|
|
- XHTML-ify single-use tags (<img>, <br>, <hr>, ...): "<img>" becomes |
|
|
"<img />". |
|
|
- Correct entities without semi-color: " " becomes " ". You can |
|
|
choose not to correct entities inside attribute-values: some people don't |
|
|
escape them. |
|
|
|
|
|
Note: The filter only checks against syntax, not against the HTML specification. |
|
|
Therefor non-existant tags or entities will pass as correct. |
|
| 9 |
|
|
|
Settings |
|
|
-------- |
|
|
|
|
|
Smart-close (Default - Enabled): |
|
|
When enabled, it's not allowed to nest identical tags. This is useful for |
|
|
correcting incorrect <p>, <option>, <li>, ... tags that are not closed. |
|
|
|
|
|
XHTMLify (Default - Disabled): |
|
|
When enabled, single-use tags such as <br> will receive a forward slash at the |
|
|
end to comply with the XHTML-specs. |
|
|
|
|
|
Fix entities inside values (Default - Disabled): |
|
|
When enabled, entities inside HTML attribute-values will be checked as well. |
|
|
It's recommended to leave this off, as most people still don't escape them. |
|
|
E.g. <a href="http://site.com/?foo=bar&bar=foo" instead of |
|
|
<a href="http://site.com/?foo=bar&bar=foo"> |
|
|
|
|
|
|
|
|
How does it work? |
|
|
----------------- |
|
|
|
|
|
On the basic level, the input-text gets scanned character by character from |
|
|
beginning to end. At each moment, the parser tries to figure out what part |
|
|
of the HTML we're in: text, a tag, a value, an entity. After a tag is done, it's |
|
|
checked against the rest of the document and corrects it where necessary. |
|
|
Certain large blocks are skipped as a whole instead of by character in order |
|
|
to speed it up (comments and regular text). During the parsing, some other |
|
|
corrections can be made as well: fixing entities, XHTML-ify'ing the source and |
|
|
changing the tree to be more logical with certain incorrectly used single tags. |
|
|
|
|
|
Requirements |
|
|
------------ |
|
|
|
|
|
This module requires the lastest version of the current Drupal CVS version. |
|
|
It won't work well into the current filter system because it's a pre-submission |
|
|
filter (the user should see his HTML after previewing and can apply more |
|
|
changes where necessary). Some filters are really better as post-submission |
|
|
filters (Drupal tags, smileys, ...). |
|
| 10 |
|
|
| 11 |
|
|
| 12 |
Installation |
Installation |
| 17 |
|
|
| 18 |
2. Enable the module in "administer" > "modules". |
2. Enable the module in "administer" > "modules". |
| 19 |
|
|
| 20 |
3. Check the "administer" > "input formats" and enable and configure the module |
3. Go to "administer" > "input formats" and enable and configure the module |
| 21 |
for the desired input format. |
for the desired input format(s). |
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|