docpad / docpad-plugin-sass

Adds support for the SASS and SCSS CSS pre-processors to DocPad. It also supports the Compass framework.
Other
13 stars 6 forks source link

Files with special chars in filenames are not ignored by renderUnderscoreStylesheets = false #4

Closed dlindenkreuz closed 11 years ago

dlindenkreuz commented 11 years ago

Files like _screen-tablet.sass are still written to out directory although they shouldn't when setting renderUnderscoreStylesheets to false.

Regular Expression for excluding these files should be:

/^_.+\.(?:scss|sass)$/

instead of

/^_(\w+)\.(?:scss|sass)$/
michaud commented 11 years ago

It looks like its actually the way you add the file. if you add the file without an underscore then it starts to render it. It doesn't keep rendering it when you rename it with an underscore, it's just already there. I've tested the regex and it works. I'm using visual studio and it places a file in the folder end then lets you rename it.

At least that is what my experiments seam to say

dlindenkreuz commented 11 years ago

That's not the issue. Files with special characters (apart from _) in filenames are not covered by the exclusion RegEx – only filenames starting with an underscore and only containing word characters (\w+) match the exclusion RegEx.

(Of course there is no attempt made to delete rendered CSS files which have been added previously and then renamed to contain an underscore and thus – in cases their filename doesn't contain any special characters apart from the underscore – match the exclusion RegEx.)

michaud commented 11 years ago

aha, but that's what the package says right?

dlindenkreuz commented 11 years ago

Not exactly. It is not specified that filenames must not contain any special characters other than underscore.

I'm dead sure it is not the developer's intention to e.g. have _somefile.css.sass excluded from rendering while _some-other-file.css.sass (mind the hyphens!) gets included in output. I still hope that this gets noticed by the project owner, as this issue can be quite confusing and hard to spot. I guess I'll send in a pull request tomorrow.

balupton commented 11 years ago

Thanks! Fixed in v2.6.0 of the plugin :)