30.3 Mapping character formats

You can specify HTML tags to be used for character formats; for example:

[CharStyles]
; Document character format name = HTML starting element name(s)
; use strong, em, code, cite, var, or blink, or span for HTML elements
Emphasis=strong
ProgramListing=code

Although the format properties listed here are the only valid HTML styles, DITA2Go lets you specify any tag, to permit XML markup and CSS span class assignments. However, only valid HTML tags have an effect in DITA2Go HTML output.

For XHTML, all format names must be lowercase.

Include attributes

To add attributes to a character tag, list them after the tag. For example:

[CharStyles]
Bold = strong type="bold"

Everything after the first space is removed for the end tag. To apply an attribute to an individual instance of a character format, insert an attribute PI marker in the inline element; see §38.3 Adding attributes with PI markers. For this example, you would use a PI marker of type CharType with content bold (no quotation marks).

If no tags are specified in [CharStyles] for a particular character format, by default that format gets a span class; see §31.7.3 Mapping character formats to tags or span classes.

Suppress tags

To eliminate style tags entirely, map the character format to nothing:

[CharStyles]
CharFmt =

See also:

§23.3.1 Deriving XML tags from format and class names

§31.7.3 Mapping character formats to tags or span classes

Previous Topic:  30.2.6 Eliminating unwanted paragraphs

Next Topic:  30.4 Mapping special characters

Parent Topic:  30. Mapping text formats to HTML/XML

Sibling Topics:

30.1 Choosing how to map formats

30.2 Mapping paragraph formats

30.4 Mapping special characters

30.5 Mapping fonts

30.6 Managing typographic elements for HTML or XML

30.7 Specifying text colors

30.8 Configuring preformatted text for HTML/XML

30.9 Converting footnotes to HTML or XML

30.10 Converting list formats to HTML (deprecated)