angular / dgeni-packages

A collection of dgeni packages for generating documentation from source code.
MIT License
142 stars 101 forks source link

fix(jsdoc): do not parse for tags within HTML blocks #214

Closed petebacondarwin closed 7 years ago

petebacondarwin commented 7 years ago

In markdown you can provide inline HTML blocks which are not parsed for further markdown syntax.

In the same way that the parseTagsProcessor ignored potential tags inside backtick code blocks, it now also ignores potential tags inside inline HTML blocks. These blocks are identified with the same semantic as inline HTML in markdown.

This fix is implemented by making the parser more generic and the modifying its behaviour by specifying "parser adapters".

Currently parse adapters must expose the following interface:

interface ParseAdapter {
  init(lines, tags);
  nextLine(line, lineNumber)
  parseForTags()
}

BREAKING CHANGE:

Tags inside HTML blocks are no longer parsed by default. If you wish this to enable this then you can modify the parseTagsProcessor.parserAdapters array from a config block:

somePackage.config(function(parseTagsProcessor, backtickParserAdapter) {
  parseTagsProcessor.parserAdapters = [backtickParserAdapter];
});