简体   繁体   中英

JSDOC Comment format

I have a property in a polymer class inside static property getter, defined like this, with comment about it above the property.

  /**
  * when textElement is empty, textElement (<text> tag) is used for limited text instead of advanced text features.
  * @name textElement
  * @alias textElement
  * @memberof ABC
  * @type {Boolean}
  */
  textElement: {
    type: String,
    value: ''
  },

I am generating documentation for the same using JSDOC, and I am encountering a weird problem, In the generated docs, this is how how comment mentioned over property looks like.

when textElement is empty, textElement ( tag) is used for limited text instead of advanced text features.

Somehow, while generating documentation JSDOC in the not understanding <text> in the comment.

Any insights on this will be helpful, thanks:)

These blocks are treated as markdown, so your <text> is being ignored as unconvertable html.

Escape the tag with backticks `<text>` ) or use \< to escape your "less than" symbol.

eg:

  * when textElement is empty, textElement (`<text>` tag) is used for limited text instead of advanced text features.

  * when textElement is empty, textElement (\<text> tag) is used for limited text instead of advanced text features.

I managed to solve the problem, As we know that.

  • &lt; stands for the [less-than sign][1] ( < ).
  • &gt; stands for the [greater-than sign][2] ( > ).

Replace < with &lt; and > with &gt; in the comment will solve the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM