I have:
input(type="hidden" name="x" value=pax?pax.C1a:undefined)
When pax
as passed to response.render
is { C1a: true }
the output is rendered as:
<input type="hidden" name="x" value="value" />
Shouldn't it be "true"?
When pax.C1a
is false, it is rendered as:
<input type="hidden" name="x" />
From HTML5 spec:
<input type="hidden" name="x" value="value" />
is the second case mentioned in the second paragraph I quoted; the first case would be<input type="hidden" name="x" value />
, both representing the true boolean. The note explicitly says what you think should be happening (value="true"
) should not be happening.If you really want
value="true"
, you have to treat it as a text attribute, and render with{ C1a: "true" }
.