Re: adding tags in JTidy

Chunbo Shao wrote:
	
	> I also want to add new tags for tidy, especially JTidy.
	> Maybe it's not a good question. What's the difference among "empty-tags",
	> "inline-tags", "blocklevel-tags" and "pre-tags"? (What i want to do is
	> just to add some tags, currently i think these tags are not uncommon.

*Which* tags are "not uncommon"?  Tidy knows about all the tags that are
legal in any official version of HTML, plus a few that are not.  Any tag
it doesn't know about is probably "quite uncommon".

empty-tags
    are tags that must have no content.  <meta>, <img>, things like that.

inline-tags
    may occur in running text (e.g., as the body of a <p>) and have
    running text as their content.  Things like <span>, <em>, <strong>,
    <a>.

    Note that since HTML 4 came out nobody has needed to define new
    inline tags for formatting reasons; <span class="your tag"> will
    do the job.

blocklevel-tags
    mark vertical divisions of a document.  They may NOT occur in running
    text.  They may occur in block context, and have block content.
    They include <div>, <center>, <blockquote>.
    <p> is sort of anomalous.  It is like a block element in that it may
    occur in block context, but it does not have block content, it only
    allows running text.  I don't think there is any way you can define
    your own <p>-like elements.

    Note that since HTML 4 came out nobody has needed to define new
    body tags for formatting reasons; <div class="your tag"> will
    do the job.

pre-tags
    Are like <p>, but preserve line breaks and allow fewer things.
    The tags that are allowed in running text but not in <pre> are
    <img>, <big>, <small>, <sub>, <sup>, and <font>.
    The only thing like this in HTML is <pre> itself.

    Note that since HTML 4 came out nobody has needed to define new
    pre tags for formatting reasons; <pre class="your tag"> will
    do the job.

The main reason for letting you define new tags in these classes is to
let you cope with an assortment of proprietary extensions, make of which
appear to have been excreted rather than designed.

Received on Wednesday, 22 August 2001 00:49:25 UTC