-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Fixed docs indentation in rootScope.js #8963
Conversation
LGTM |
Not LGTM --- I don't think this is the right fix for this :( Fixing the trimming behaviour in dgeni would make more sense. Otherwise the code looks really weird. |
@petebacondarwin --- Why don't we pick out the leading whitespace from each line in each sample, and remove the length of the shortest one from each line which starts with it? It would take more time to process, but we'd get correct results without making the codebase look weird. Given that code snippets are typically not very long, it seems reasonable to me. |
@caitp - we do this already with jsdoc comments but I am sure there was some reason why it didn't work for code blocks. One, perhaps more attractive, solution is to leave the stars at the start of each line:
Since we strip off leading whitespace and stars. I'll have a look at the dgeni code again. |
So I looked at the code again. If there is a dgeni template that uses nunjucks
If there is an inline example, using
But at the moment the code blocks within markdown (indicated by ```) are not being trimmed since dgeni is not aware of them. They are passed straight through to the marked parser. |
Looks like there might be a hook in |
The service will trim indentation from code before rendering, which fixes angular/angular.js#8963
Well it will be closed when PR #9093 lands. |
Now its landed! |
dgeni-packages 0.10.0-rc.5 has a fix for this problem, so this commit updates to that version. Adds a new e2e test to prove this is fixed. Closes angular#8963
No description provided.