在ASDoc注释中包含@且没有任何错误? [英] Include @ in ASDoc comments without any errors?

查看:69
本文介绍了在ASDoc注释中包含@且没有任何错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您在ASDoc中使用@符号,则会编译代码,但是ASDoc的生成器会大声喊出难以理解的错误消息.

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

是否可以在ASDoc中包含@符号而不会引发错误?

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

推荐答案

根据 Adob​​e提供的文档:

ASDoc将所有HTML标记和标记实体的注释传递给输出.因此,如果要在注释中使用特殊字符,请使用等效的HTML代码输入它们.例如,要在注释中使用小于(<)或大于(>)符号,请使用&lt;&gt;. 要在注释中使用符号(@),请使用&#64;.否则,这些字符将在输出中解释为原义HTML字符.

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.

尽管文档中未提及,但不允许的第四个符号是&,必须用&amp;代替.

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

因此,如果要按照示例ASD​​oc的说明进行操作:

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

在编辑器中查看注释时可能不清楚,但是一旦将ASDoc编译为HTML,就将变得清晰.也许可以这样一种方式来表达评论,即不使用特殊字符:

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;)

这篇关于在ASDoc注释中包含@且没有任何错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆