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

Add self-closing support for custom template tags #56

Closed
hijonathan opened this issue Nov 30, 2011 · 2 comments
Closed

Add self-closing support for custom template tags #56

hijonathan opened this issue Nov 30, 2011 · 2 comments

Comments

@hijonathan
Copy link
Contributor

Example:

- mytag
      Add stuff here

compiles to:

{% mytag %}
      Add stuff here
{% endmytag %}

It'd be nice to support these and just assume/require that we adhere to typical django naming conventions (e.g. the closing tag starts with "end").

@bcoughlan
Copy link
Collaborator

Are there any scenarios where a tag followed by an indented line shouldn't be self-closing?

@hijonathan
Copy link
Contributor Author

Yeah, actually this would be a problem for custom one-liner tags.

Example:

- wrap_in_anchor "http://www.example.com"

should compile to:

{% wrap_in_anchor "http://www.example.com" %}

which could then be used to wrap the passed value in a special anchor tag or whatever.

I think there may be a better way to do this, but I haven't quite figured it out yet.

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

No branches or pull requests

2 participants