Question

If you have the @ symbol in your ASDoc, the code will compile, but the generator for the ASDoc will yell out an unintelligible error message.

/**
 * Removes the following characters which are forbidden:
 *    @/\"#$%&'()*:;<=>!?
 */
public function removeForbiddenChars(str:String):String

Is there any way to include the @ symbol in your ASDoc without an error being thrown?

Was it helpful?

Solution

According to documentation by Adobe:

ASDoc passes all HTML tags and tag entities in a comment to the output. Therefore, if you want to use special characters in a comment, enter them using HTML code equivalents. For example, to use a less-than (<) or greater-than (>) symbols in a comment, use &lt; and &gt;. To use the at-sign (@) in a comment, use &#64;. Otherwise, these characters are interpreted as literal HTML characters in the output.

Although not mentioned in the documentation,a fourth symbol that is not allowed is &, and must be replaced by &amp;.

So, if one were to follow these instructions for the example ASDoc:

/**
 * Removes the following characters which are forbidden:
 *    &#64;/\"#$%&amp;'()*:;&lt;=&gt;!?
 */
public function removeForbiddenChars(str:String):String

It may not be clear when looking at the comment in your editor, but it will be clear once the ASDoc has been compiled into HTML. Perhaps one could phrase the comment in such a way that the special characters aren't used:

Removes /\"#$%'()*:;=!? as well as the 'at' symbol (&#64;), the ampersand symbol (&amp;), the 'less than' symbol (&lt;), and the 'greater than' symbol (&lt;)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top