<feed xmlns='http://www.w3.org/2005/Atom'>
<title>askama/testing/templates, branch main</title>
<subtitle>added poem support</subtitle>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/'/>
<entry>
<title>Allow included templates to `extend`, `import`, and `macro`</title>
<updated>2024-01-17T16:58:53+00:00</updated>
<author>
<name>max</name>
<email>gmx.sht@gmail.com</email>
</author>
<published>2023-12-11T14:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=5cad82f38e800a42717284f20e7e0923add1e32f'/>
<id>5cad82f38e800a42717284f20e7e0923add1e32f</id>
<content type='text'>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add better support for rust-like number literals (#908)</title>
<updated>2023-11-22T15:09:33+00:00</updated>
<author>
<name>PizzasBear</name>
<email>43722034+PizzasBear@users.noreply.github.com</email>
</author>
<published>2023-11-22T15:09:33+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=696561003d9caaf5d1fd537d6a0f4f88fccca8ce'/>
<id>696561003d9caaf5d1fd537d6a0f4f88fccca8ce</id>
<content type='text'>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Enhance match to include multiple targets (#911)</title>
<updated>2023-11-22T13:56:14+00:00</updated>
<author>
<name>PizzasBear</name>
<email>43722034+PizzasBear@users.noreply.github.com</email>
</author>
<published>2023-11-22T13:56:14+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=48c6cd327d3c1df4218898be509250efcc56597c'/>
<id>48c6cd327d3c1df4218898be509250efcc56597c</id>
<content type='text'>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Add test specifically for named blocks, and named macros</title>
<updated>2023-10-23T13:13:27+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2023-10-23T11:32:37+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=a7f5186bf49ef20010c2eae7717b3a738a3b548e'/>
<id>a7f5186bf49ef20010c2eae7717b3a738a3b548e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add test for macro self argument</title>
<updated>2023-10-12T11:57:48+00:00</updated>
<author>
<name>max</name>
<email>gmx.sht@gmail.com</email>
</author>
<published>2023-10-12T11:47:49+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=5ee2dfbe6bf901c7c731e9b94ba92b82f09e9101'/>
<id>5ee2dfbe6bf901c7c731e9b94ba92b82f09e9101</id>
<content type='text'>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Rust macro invocations not accepting a path (#837)</title>
<updated>2023-07-24T09:39:14+00:00</updated>
<author>
<name>Matthew Taylor</name>
<email>wrapperup4@gmail.com</email>
</author>
<published>2023-07-24T09:39:14+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=ac8de6260e34c7dc7f7f2228e832d1860a31707d'/>
<id>ac8de6260e34c7dc7f7f2228e832d1860a31707d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow macros to be defined and called without arguments</title>
<updated>2023-06-12T08:35:40+00:00</updated>
<author>
<name>mataha</name>
<email>mataha@users.noreply.github.com</email>
</author>
<published>2023-06-10T02:57:56+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=cba1fb8e508eae87d213e7bc4c7b2eb8b4b92732'/>
<id>cba1fb8e508eae87d213e7bc4c7b2eb8b4b92732</id>
<content type='text'>
This commit introduces a shorthand for defining and calling macros when
using them as a reusable substitute for variables assigned complex values
(e.g. string literals with or without newline escapes). The use-case is
formatting - from my experience it's easier to visually parse a `macro`
`endmacro` block than a multiline variable assignment.

Signed-off-by: mataha &lt;mataha@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit introduces a shorthand for defining and calling macros when
using them as a reusable substitute for variables assigned complex values
(e.g. string literals with or without newline escapes). The use-case is
formatting - from my experience it's easier to visually parse a `macro`
`endmacro` block than a multiline variable assignment.

Signed-off-by: mataha &lt;mataha@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Propogate size_hint from sub-blocks (#788)</title>
<updated>2023-03-06T21:18:45+00:00</updated>
<author>
<name>Andrew Dona-Couch -- GitHub drop ICE</name>
<email>hi@andrewcou.ch</email>
</author>
<published>2023-03-06T21:18:45+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=dc864486ec8c258388b4e006d9517e6e30c34a4d'/>
<id>dc864486ec8c258388b4e006d9517e6e30c34a4d</id>
<content type='text'>
Closes #786</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #786</pre>
</div>
</content>
</entry>
<entry>
<title>Allow `{% endmacro name %}`</title>
<updated>2022-04-29T11:35:20+00:00</updated>
<author>
<name>Bastien Orivel</name>
<email>bastien@technocreatives.com</email>
</author>
<published>2022-04-29T11:12:18+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=ea66be1925456285f897bc00a076e4e7af94c313'/>
<id>ea66be1925456285f897bc00a076e4e7af94c313</id>
<content type='text'>
Just migrated a repo from tera to askama and this was one of the only
things that was different. This is also coherent with `{% block %}` for
which I added the same feature years ago.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Just migrated a repo from tera to askama and this was one of the only
things that was different. This is also coherent with `{% block %}` for
which I added the same feature years ago.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make json filter safe</title>
<updated>2022-02-16T13:51:39+00:00</updated>
<author>
<name>René Kijewski</name>
<email>kijewski@library.vetmed.fu-berlin.de</email>
</author>
<published>2022-02-01T14:32:37+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=29f0c0607ad3d25491f4c4a6ca19b463610ae92d'/>
<id>29f0c0607ad3d25491f4c4a6ca19b463610ae92d</id>
<content type='text'>
Previously the built-in json filter had an issue that made it unsafe to
use in HTML data. When used in HTML attributes an attacker who is able
to supply an arbitrary string that should be JSON encoded could close
the containing HTML element e.g. with `"&lt;/div&gt;"`, and write arbitrary
HTML code afterwards as long as they use apostrophes instead of
quotation marks. The programmer could make this use case safe by
explicitly escaping the JSON result: `{{data|json|escape}}`.

In a `&lt;script&gt;` context the json filter was not usable at all, because
in scripts HTML escaped entities are not parsed outside of XHTML
documents. Without using the safe filter an attacker could close the
current script using `"&lt;/script&gt;"`.

This PR fixes the problem by always escaping less-than, greater-than,
ampersand, and apostrophe characters using their JSON unicode escape
sequence `\u00xx`. Unless the programmer explicitly uses the safe
filter, quotation marks are HTML encoded as `&amp;quot`. In scripts the
programmer should use the safe filter, otherwise not.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously the built-in json filter had an issue that made it unsafe to
use in HTML data. When used in HTML attributes an attacker who is able
to supply an arbitrary string that should be JSON encoded could close
the containing HTML element e.g. with `"&lt;/div&gt;"`, and write arbitrary
HTML code afterwards as long as they use apostrophes instead of
quotation marks. The programmer could make this use case safe by
explicitly escaping the JSON result: `{{data|json|escape}}`.

In a `&lt;script&gt;` context the json filter was not usable at all, because
in scripts HTML escaped entities are not parsed outside of XHTML
documents. Without using the safe filter an attacker could close the
current script using `"&lt;/script&gt;"`.

This PR fixes the problem by always escaping less-than, greater-than,
ampersand, and apostrophe characters using their JSON unicode escape
sequence `\u00xx`. Unless the programmer explicitly uses the safe
filter, quotation marks are HTML encoded as `&amp;quot`. In scripts the
programmer should use the safe filter, otherwise not.
</pre>
</div>
</content>
</entry>
</feed>
