]>
Commit | Line | Data |
---|---|---|
1 | AutoFormat.RemoveEmpty\r | |
2 | TYPE: bool\r | |
3 | VERSION: 3.2.0\r | |
4 | DEFAULT: false\r | |
5 | --DESCRIPTION--\r | |
6 | <p>\r | |
7 | When enabled, HTML Purifier will attempt to remove empty elements that\r | |
8 | contribute no semantic information to the document. The following types\r | |
9 | of nodes will be removed:\r | |
10 | </p>\r | |
11 | <ul><li>\r | |
12 | Tags with no attributes and no content, and that are not empty\r | |
13 | elements (remove <code><a></a></code> but not\r | |
14 | <code><br /></code>), and\r | |
15 | </li>\r | |
16 | <li>\r | |
17 | Tags with no content, except for:<ul>\r | |
18 | <li>The <code>colgroup</code> element, or</li>\r | |
19 | <li>\r | |
20 | Elements with the <code>id</code> or <code>name</code> attribute,\r | |
21 | when those attributes are permitted on those elements.\r | |
22 | </li>\r | |
23 | </ul></li>\r | |
24 | </ul>\r | |
25 | <p>\r | |
26 | Please be very careful when using this functionality; while it may not\r | |
27 | seem that empty elements contain useful information, they can alter the\r | |
28 | layout of a document given appropriate styling. This directive is most\r | |
29 | useful when you are processing machine-generated HTML, please avoid using\r | |
30 | it on regular user HTML.\r | |
31 | </p>\r | |
32 | <p>\r | |
33 | Elements that contain only whitespace will be treated as empty. Non-breaking\r | |
34 | spaces, however, do not count as whitespace. See\r | |
35 | %AutoFormat.RemoveEmpty.RemoveNbsp for alternate behavior.\r | |
36 | </p>\r | |
37 | <p>\r | |
38 | This algorithm is not perfect; you may still notice some empty tags,\r | |
39 | particularly if a node had elements, but those elements were later removed\r | |
40 | because they were not permitted in that context, or tags that, after\r | |
41 | being auto-closed by another tag, where empty. This is for safety reasons\r | |
42 | to prevent clever code from breaking validation. The general rule of thumb:\r | |
43 | if a tag looked empty on the way in, it will get removed; if HTML Purifier\r | |
44 | made it empty, it will stay.\r | |
45 | </p>\r | |
46 | --# vim: et sw=4 sts=4\r |