Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.

Trailing directives break groundskeeper #26

Closed
betaorbust opened this issue Sep 15, 2015 · 0 comments · May be fixed by #28
Closed

Trailing directives break groundskeeper #26

betaorbust opened this issue Sep 15, 2015 · 0 comments · May be fixed by #28

Comments

@betaorbust
Copy link
Contributor

betaorbust commented Sep 15, 2015

Currently, groundskeeper just matches on /^[<]([/]([^\s])[>]$/ for any pragma and then does an every-other pass to decide what to strip out. If there's a trailing open directive, everything breaks because of the while(ranges.length) block calling ranges.shift twice.

console.log('keep me!');
if(foo){
    //<pragma>
    console.log('oops!'); 
}

Causes
turns into:

console.log('keep me!');
if(foo){

The fix will be to just change it to while(ranges.length > 1) and ignore the broken pragmas.

betaorbust added a commit to betaorbust/groundskeeper that referenced this issue Sep 15, 2015
@Couto Couto closed this as completed Oct 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants