v0.3.1 — Notification accepts body content
A patch for one bug, shipped on its own because of how it fails.
Notification discarded body content in every theme and both engines, and in django-cotton it did so silently — no error, no warning, and a call site that reads correctly. Anyone using the natural container form has been getting a correctly styled, correctly coloured, empty box, with nothing in their own code or logs to say so. This predates 0.1.1, so every release to date is affected.
Upgrade if you pass children to <c-cf.notification> or <Cf:Notification>. If every call site passes message=, nothing changes for you.
{# rendered an empty box before 0.3.1 #}
<c-cf.notification type="danger" dismissible="false">
<strong>{{ error }}</strong>
</c-cf.notification>Fixed — Notification silently discarded its body content (#65)
- Body content now renders in all ten templates — five themes × two engines — falling back to the scalar
messagewhen no body is given.message=callers are untouched; the JinjaX signature only loosens (messagerequired → optional) and the cotton wrapper only gains a<c-vars>default. No migration. - A body that renders to nothing is not a body. django-cotton hands the partial its nodelist output verbatim, so a paired tag whose body renders empty still supplies
"\n "— truthy. Without a guard, amessage=caller writing a conditional body would get an empty box on the false branch, which is the same bug with a new trigger. Both engines treat a whitespace-only body as absent. - The two content channels want opposite escaping and now get it, under test. JinjaX wraps slot content in
Markup, so a body passes through the template's{% autoescape true %}block untouched, whilemessageis caller-supplied text and stays escaped. Both halves are asserted per theme rather than left to autoescape semantics. - Foundation's
<p>now wrapsmessagealone. Broadening the content channel made an existing wrapper wrong: the HTML parser closes an open paragraph on block content, so<p><ul>…</ul></p>parses to<p></p><ul>…</ul><p></p>, reparenting the body onto.calloutand leaving two empty paragraphs for Foundation's own.callout > :first-child/> :last-childmargin rules to match. The scalar form renders byte-identically to 0.3.0. Fomantic's<div class="content">and bootstrap/daisy's<span>hold block content without being restructured, and are unchanged. - Covered at the tier that could have caught it. The bug survived because no test tier that ran the django-cotton compiler looked at this component's content channel: the unit tier injects
slotas raw context, and the integration tier does not installdjango_cottonat all. The three cotton call forms are now asserted in E2E, whereslotis built by cotton itself.
Full changelog: v0.3.0...v0.3.1