allow omitting the false option in option tags (will use empty text)

This commit is contained in:
Jason Penilla committed 2023-10-04 17:39:54 -07:00
1 parent d19693120c
commit d331d399f9
1 file changed
+5 -2
@@ -45,8 +45,11 @@ public final class OptionTagResolver implements TagResolver {
return null;
}
final Tag.Argument t = arguments.popOr("Missing option 1");
final Tag.Argument f = arguments.popOr("Missing option 2");
return Tag.preProcessParsed(this.state ? t.value() : f.value());
String f = "";
if (arguments.peek() != null) {
f = arguments.pop().value();
}
return Tag.preProcessParsed(this.state ? t.value() : f);
}
@Override