Fix annotation parsing in nested comment blocks#25
Fix annotation parsing in nested comment blocks#25davidknezic wants to merge 2 commits intoSassDoc:masterfrom
Conversation
|
Hi, thanks for the PR! Could you please write a few unit tests so that the feature is clearly defined? Also running the unit tests from the main sassdoc lib with that patched dependency would be quite reassuring. |
|
What's the latest on this? I'm writing my scss with bem conventions like this: I'm using the Herman theme (https://github.com/oddbird/sassdoc-theme-herman) and use a But I'd really need the Update: |
Needs unit tests. |
I need to be able to document classes that are nested. Like in this example:
This works, except for all the annotation handling. Annotations don't get recognized and all land in the description. The reason for that is how indented comments get returned from
CDocParser.CommentExtractor. The snippet above would result in this output:{ "lines": [ "text", " ", " @example", " <div class=\"fade-in-xs-up\">", " <span>Test</span>", " </div>" ], "type": "line", "commentRange": { "start": 43, "end": 48 }, "context": {} }The
filterAndGroupfunction then filters and groups the lines and uses the following to detect annotations:This of course doesn't work, because some of the lines are indented.
This fix trims the comment lines to detect annotations, uses the trimmed lines when pushing into a new group and then keeps using the untrimmed line so intentional indentation doesn't get lost (ex. in @example source code).