Parser icon indicating copy to clipboard operation
Parser copied to clipboard

The markup parser doesn't correctly determine nextParserIndex in most usecases

Open erikhagreis opened this issue 9 years ago • 2 comments

The markup parser (as prototype of any multi-line parser) does not correctly determine the end of the current multi-line comment segment.

This is the problematic code:

// find the next instance of a parser (if there is one based on the @ symbol)
// in order to isolate the current multi-line parser
var nextParserIndex = block.indexOf('* @', i+1),

I think the indexOf('* @') call assumes a situation where comments are written in the following style example:

/**
 * @markup
 * <button>click</button>
 *
 * @state :hover - When mouse rolls over
 */

If this style of commenting (with leading *'s each line) is not followed, the nextParserIndex will not be detected and the markup section is assumed to last the rest of the comment block. Adding parseable lines below a markup section like in the example above will result in those lines being included in the markup.

erikhagreis avatar May 27 '16 08:05 erikhagreis

@darcyclarke: if you want I can propose a pull request to fix this issue (but it would require some discussion regarding the correct approach)

erikhagreis avatar May 27 '16 09:05 erikhagreis

Has there been any movement on this? I am also willing to contribute if you have a direction that you are wanting to move in.

pauljeter avatar Sep 21 '16 13:09 pauljeter