#### 28.2.5 Replacing problem characters in links

Some characters that are acceptable in DITA hypertext links and cross references cause problems for browsers; for example, HTML insists on all-lowercase IDs. DITA2Go processes DITA hypertext links and cross references to ensure acceptable IDs, similar to the way CSS class names are processed; see §31.7.1 Understanding CSS class name restrictions.

Spaces are removed or replaced

Part of the job is to remove all spaces, possibly replacing them with another character when that is necessary to prevent name clashes. You can specify any alphanumeric character (or a hyphen or an underscore) to replace spaces.

To set the character used to replace spaces in links:

    [HTMLOptions]
    ; These alphanumeric chars are used as space replacements in IDs;
    ; if non-alphanumeric (other than hyphen or underscore), spaces are
    ; stripped instead (default)
    ; XrefSpaceChar = alphanumeric char to use in xref markers
    XrefSpaceChar=-
    ; HyperSpaceChar = alphanumeric char to use in hyperlinks (not URLs)
    HyperSpaceChar=-

By default, DITA2Go removes spaces without replacing them. The same thing happens if you set XrefSpaceChar or HyperSpaceChar to any non-alphanumeric character other than a hyphen or an underscore: DITA2Go removes all spaces without replacing them.

Previous Topic: 28.2.4 Specifying link properties with macros

Next Topic: 28.2.6 Forcing link text to lowercase

Parent Topic: 28.2 Specifying link appearance

Sibling Topics:

28.2.1 Specifying link colors

28.2.2 Specifying link class

28.2.3 Assigning link attributes with PI markers

28.2.4 Specifying link properties with macros

28.2.6 Forcing link text to lowercase

Table of Contents • Index