Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug: When compiling Kit, importing w/ `:` or `=` works, but CodeKit doesn't ignore the included file #541

Open
calvinjuarez opened this Issue · 1 comment

2 participants

@calvinjuarez

I discovered this bug during testing of edge cases while developing a JS port for Kit.

index.kit

<!--@import:partial.kit-->

OR

<!--@include=partial.kit-->

Assuming partial.kit exists in an importable location, saving it will result in the creation of index.html and partial.html.

I'm not sure that <!-- @import:filename.ext --> is even "allowed" according to the Kit help page, but the compiler makes no distinction between a predicate that follows a variable keyword and one that follows @import or @include, so it doesn't currently prohibit the use of colon or equals.

It's not a giant bug, since putting a space after the keyword fixes things. Just figured I'd report it.

@calvinjuarez calvinjuarez changed the title from Bug: When compiling Kit, importing w/ `:` or `=` works, but doesn't ignore the included file to Bug: When compiling Kit, importing w/ `:` or `=` works, but CodeKit doesn't ignore the included file
@bdkjones
Owner

Interesting. The use of : or = is explicitly an error. The syntax for imports is meant to follow the syntax that CSS and Sass use, which does not include any punctuation.

I think the correct behavior here is to simply ignore the entire comment and treat it as if no special keywords had been found. The compiler should be testing for the presence of either @import or @include (with a space at the end).

These are the sort of edge cases you run into when you don't use a full parser!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.