Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added ability to use quotes in include tag #188

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zeraien
Copy link

@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
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
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 :)

@kakulukia
Copy link

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