Solution

A new Validation test introduced in Catalyst 10 (build 100171), allows you to check for missing spaces around inline tags.

This test included in the Validation Expert test list, as seen below in the User Profile below, will report on tags missing a space before or after.
The test runs in the UI, via the Validation Expert and Online Validation, and runs in ezScript.
 

 

The configuration file

The set of tags associated with the Missing space around tags test is configured in an XML file located in the install directory. By default:

Windows 32-bit operating systems
C:\Program Files\Alchemy Software\Catalyst 10.0\Public Files\validation_configuration.xml

Windows 64-bit operating systems
C:\Program Files (x86)\Alchemy Software\Catalyst 10.0\Public Files\validation_configuration.xml

It is not necessary to modify the tags to use the Validation test, however you may need to add or remove some tags depending on your project needs. Next we review the meaning of the tags per category and how characters around the tags should be treated by the test.

 

Tag categories

To support their different requirements for preceding or following whitespace, tags have been categorized as follows:

Space either side

Regular tags requiring a whitespace at one end, such as <b>, <strong>, <u>, <i>, etc... They require one space to be present at either end of the tag. They are tags delimiting a style within the string and are not treated like a word.
The validation test will fail should no space is present either before or after the tag.
 

 
Element syntax in validation_configuration.xml: <space-either-side>
 

Default values in validation_configuration.xml:

 

<space-either-side>

<tag>strong</tag>

<tag>u</tag>

<tag>span</tag>

<tag>b</tag>

<tag>i</tag>

<tag>a</tag>

</space-either-side>

Space at both sides

Self-closing tags requiring whitespaces at both ends, such as Madcap tags. They require a space at either end because they are replaced by a word during compilation; the tag is a placeholder.
The validation test will report an error if either the space before or after is missing.

 

Element syntax in validation_configuration.xml: <space-both-sides>

 

Default values in validation_configuration.xml:

 

<space-both-sides>

<tag>MadCap:variable</tag>

</space-both-sides>

No validation

Tags that are considered themselves as whitespace, thus do not require a space around them, for example the MadCap tag <MadCap:keyword>.
The <nbsp> inline tag is always treated as a space in Catalyst and so it is unnecessary to have it listed in this or any other Category.
The validation test by default will not report an issue as no space is required.

 

Element syntax in validation_configuration.xml: <no-validation>

 

Default values in validation_configuration.xml:

 

<no-validation>

<tag>MadCap:keyword</tag>

<tag>MadCap:concept</tag>

</no-validation>

 

Tags found at beginning or end of string

In all cases, the test is ignored for inline tags found at the beginning or the end of a string. This is because a space will not be necessary after a tag located at the end of a string and likewise at the start. This also applies to "space at both sides" inline tags. Depending on the position of the "space at both sides" tag at start or end of the string, the relevant space test before or after the tag will be ignored.

 

Characters found around tested inline tags

In many cases, some characters will be directly before or after an inline tag as part of the Validation test. This character may need to be present directly after the tag and should not fail the test. The characters fall under 2 categories explained below.

Acceptable characters

The acceptable characters list includes a set of characters which are allowed to be present between the inline tag and the space character. If a tag is followed by one of the acceptable character, the test will ignore this character and allow the space to follow or precede it without failing.

Example:

In the string “This is an<tag>: element” the character : is considered as a valid separation (whitespace) between the <tag> and the next word element.

 

Default values in validation_configuration.xml:

 

<acceptable-chars>

<chars>()</chars>

<chars>"</chars>

<chars>“”</chars>

<chars>'</chars>
<chars>;:</chars>

</acceptable-chars>

• Characters treated as space

Characters in this list are considered as equivalent of a whitespace within the scope of the Missing space around tags validation test. They are allowed to substitute the space character.

Example:

In the string “This is very <tag>-important” the character - is treated as a space character and the Validation test does not report a missing space between <tag> and the word important.

 

Default values in validation_configuration.xml:

 

<like-space-chars>

<chars>-</chars>

<chars>—</chars>

</like-space-chars>

It is possible to add more than one character in the above groups. For example, <chars>()</chars> includes either the opening or closing brackets as an acceptable character in the default validation_configuration.xml file. It is the same as having two entries like <chars>(</chars> and <chars>)</chars>.
Technically, all characters could be in one <chars> element but this would not be as readable ;-)

 

While performing the Validation test

As with all other validation tests, you can avoid reporting issues which exist in the source and thus don't need to be corrected. To achieve this select the Ignore error if present in source option in the Validation Expert.
Using this option assumes that any error in source is intentional and should be adhered to.

While reviewing the reported strings in the Translator Toolbar, use the Toggle Space Markers to view the spaces graphically. For example below, with the option turned on it is easier to see the missing space character after the self-closing tag. It actually is in source also.

 

Samples

Copy of the default validation_configuration.xml file.

 

Products or Versions Affected

  • Alchemy CATALYST 10.0  and greater

 

Last updated with Catalyst 10