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
Whilst creating a custom UnsafeUnescapedLeafTag, context.requireNoBody() always throws even if no body is provided, while context.requireBody() never throws even when no body is provided, rather returning an empty [Syntax].
While looking through the tests I noticed these methods are not tested anywhere and I think simply checking for the array being empty in addition to checking for it being != nil could solve the issue. The other option would be searching where the body of the tag is passed in and setting it to nil if it's an empty array
Describe the bug
Whilst creating a custom
UnsafeUnescapedLeafTag
,context.requireNoBody()
always throws even if no body is provided, whilecontext.requireBody()
never throws even when no body is provided, rather returning an empty[Syntax]
.While looking through the tests I noticed these methods are not tested anywhere and I think simply checking for the array being empty in addition to checking for it being
!= nil
could solve the issue. The other option would be searching where thebody
of the tag is passed in and setting it tonil
if it's an empty arrayTo Reproduce
and
or
This returns
Hello there
, which is just the return type of the tag, while it should be returning{error: true, reason: "Missing body"
This returns
{error: true, reason: "Extraneous body"}
The only way to make this error go away is to set the template as
Which is, I think, not that intuitive
Environment
4.76.0
18.6.0
MacOS Ventura 13.0
14.1 (14B47b)
The text was updated successfully, but these errors were encountered: