Merge branch 'dirtyhack/strip_underline_blank'
[perl-HTML-WikiConverter-DokuWiki.git] / README-strip-blank.html
blobcc847b2dde946c3d5186dc2ae121707e33939967
1 <h5>Stripping blank elements</h5>
3 <p>Stripping blank elements has been implemented, i.e., elements that
4 have no real text inside.
5 This can enhance the readabilty of output considerably, especially
6 when converting some automatically generated HTMLs.</p>
8 <p>By default, this only applies to tags for
9 which this makes sense, i.e., FONT-like modifiers such as STRONG,
10 EM, B, I, FONT. There are some other similar tags (such as CODE, TT,
11 U, S) whose formatting can be important even on blanks and hence
12 they are not stripped by default.</p>
14 <p>Note that, as a result, text formatting markup around images is stripped (which
15 is good, because the markup is useless there).</p>
17 <h6>Optional stripping of blank elements</h6>
19 <p><code>--strip-blank-underline</code> command-line switch turns
20 stripping of blank underlines (U tags) on, too. This can be useful for
21 some generated HTMLs with meaningless underline.</p>
23 <h6>On implementation and future work</h6>
25 <p>The transformation is implemented on the level of HTML structure.
26 I considered also implementing it on the level of the resulting
27 wiki-text. On HTML level, it's straightforward that an image has no
28 real text, and hence the formatting around it is to be stripped. On
29 the level of plain text with wiki-markup, that wouldn't be so
30 straightforward.</p>
32 <p>However, there is a related kind of pretty transformation that
33 would be easier to perform on a level closer to the resulting
34 wiki-text. Namely, "pushing" space from the edges out of the
35 formatting. For example, something like <code>**Attention:&nbsp;**</code>
36 should become <code>**Attention:** </code> (with the space being
37 preserved outside). This can be easily implemented on the level of
38 translation rules, we already have translated the content into
39 wiki-text. Think of it as a variant of the
40 <code>trim&nbsp;=&gt;&nbsp;both</code> rule, which would rather copy
41 the space to the outside. This is for future work.
42 </p>