You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto j = parseJsonString(`{"foo": 42}`);
auto foo = j.foo;
res.render!("test.dt", foo);
and a template like:
doctype html
html
head
title Bug
body
p before
p= foo
p after
You will only get the content until "before". Everything after is silently dropped. This can be worked around by using something like:
auto j = parseJsonString(`{"foo": 42}`);
auto foo = j.foo.get!int;
res.render!("test.dt", foo);
I think the diet renderer should be able to work with raw Json nodes (without using get!T or to!T), but in any case it should not truncate the output silently.
The text was updated successfully, but these errors were encountered:
The root cause is that the p= foo will issue a cast(string)foo, which in turn calls foo.get!string(). However, the type is int, so an exception is thrown, hence the cut off page (run the application with -v or --vv to see the exception). I think in this case, it will be safe to change the rule of how values are converted to strings in vibe.templ.diet._toString. Instead of trying to cast(), try to use toString() first (currently this is done only if casting isn't possible).
Given the vibe.d code:
and a template like:
You will only get the content until "before". Everything after is silently dropped. This can be worked around by using something like:
I think the diet renderer should be able to work with raw Json nodes (without using
get!T
orto!T
), but in any case it should not truncate the output silently.The text was updated successfully, but these errors were encountered: