Skip to content

added ability to use quotes in include tag#188

Open
zeraien wants to merge 3 commits intosyrusakbary:masterfrom
zeraien:include_quoted_filenames
Open

added ability to use quotes in include tag#188
zeraien wants to merge 3 commits intosyrusakbary:masterfrom
zeraien:include_quoted_filenames

Conversation

@zeraien
Copy link
Copy Markdown

@zeraien zeraien commented Apr 6, 2015

if you have filenames with spaces or wish to use additional django-specific include flags, like "with foo=bar", you need to be able to surround the filename with double or single quotes.
This commit simply strips quotes from any path passed to the include or extends tags.

@zeraien
Copy link
Copy Markdown
Author

zeraien commented Apr 17, 2015

On the other hand, Jade itself does not require (or understand) quotes in the include or extends tags, so maybe I jumped the gun here. I kinda thought one could take this a step further to allow tags like djangos:
{% include "foo" with bar=baz %}...
But that essentially makes it invalid jade... what do you think, should we break jade a bit?

@blx
Copy link
Copy Markdown
Contributor

blx commented Aug 15, 2015

We can already use django's own include tag with the hyphen templatetag

- include "foo" with bar=baz

so it seems to me that keeping compatibility with Jade as much as possible would be nice for the actual include tag. Using templatetags for compiler-specific stuff also avoids having to try too much polyfilling across compiler backends (jinja's include takes different optional args than django's, etc.)

This is all just my opinion, though :)

@syrusakbary syrusakbary force-pushed the master branch 3 times, most recently from 4a76e8a to eb84811 Compare January 7, 2016 17:08
@kakulukia
Copy link
Copy Markdown

Since there are no updates to pyjade and its successor recently was deleted from pypi, I took the liberty to revive it: https://github.com/kakulukia/pypugjs

Version 5.0.1 has fixed the incompatibility with recent Django versions.
I'll be might be happy to merge this into the next version if you resubmit the PR to my repo. Not sure if this is really needed somehow. I personally never had a problem with imports. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants