문제

I am wanting to output examples which has HTML within it such as

* @example
*     <div ng-app="reportingBuilderApp">
*         <div ng-view></div>
*     </div>

But at the moment it renders it "safely" as HTML however I want it as text, at the moment I am needing to write the example as below (which is much more tedious and ugly in the actual JS)

* @example
*     &lt;div ng-app="reportingBuilderApp"&gt;
*         &lt;div ng-view&gt;&lt;/div&gt;
*     &lt;/div&gt; 

Is there any way of sorting JSDoc to prevent the HTML from being output "safely" automatically?

도움이 되었습니까?

해결책

Using version 3.3.0-alpha4, with the following test file:

/**
 * @example
 * <div ng-app="reportingBuilderApp">
 *     <div ng-view></div>
 * </div>
 */
function foo() {
}

I get an example that shows up correctly in the output of jsdoc.

As the name suggests, 3.3.0-alpha4 is still in alpha. To my knowledge there is no version previous to 3.3.0-alpha... which has the fix for this problem, and no workaround for it. The bug report that prompted the fix is here.

다른 팁

There is no way to get around this. You will need to use HTML escape code if you want to show the < and > symbols in the final HTML JSDoc pages.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top