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

Trailing directives break groundskeeper #26

@betaorbust

Description

@betaorbust

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions