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

Implement 'xmlattr' filter #143

Closed
flexferrum opened this issue Sep 25, 2019 · 1 comment
Closed

Implement 'xmlattr' filter #143

flexferrum opened this issue Sep 25, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request hacktoberfest Issues for Hacktoberfest

Comments

@flexferrum
Copy link
Collaborator

flexferrum commented Sep 25, 2019

Implement 'xmlattr' filter according to the jinja2 specification:

Create an SGML/XML attribute string based on the items in a dict. All values that are neither none nor undefined are automatically escaped:

<ul{{ {'class': 'my_list', 'missing': none,
        'id': 'list-%d'|format(variable)}|xmlattr }}>
...
</ul>

Results in something like this:

<ul class="my_list" id="list-42">
...
</ul>

As you can see it automatically prepends a space in front of the item if the filter returned something unless the second parameter is false.

@flexferrum flexferrum added enhancement New feature or request hacktoberfest Issues for Hacktoberfest labels Sep 25, 2019
@vvish
Copy link

vvish commented Oct 22, 2019

Please assign this task on me

vvish pushed a commit to vvish/Jinja2Cpp that referenced this issue Nov 7, 2019
vvish pushed a commit to vvish/Jinja2Cpp that referenced this issue Nov 7, 2019
vvish pushed a commit to vvish/Jinja2Cpp that referenced this issue Nov 19, 2019
vvish pushed a commit to vvish/Jinja2Cpp that referenced this issue Nov 19, 2019
vvish pushed a commit to vvish/Jinja2Cpp that referenced this issue Nov 21, 2019
vvish pushed a commit to vvish/Jinja2Cpp that referenced this issue Nov 21, 2019
vvish pushed a commit to vvish/Jinja2Cpp that referenced this issue Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Issues for Hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants