diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 0bef3e9..3bbbdaf 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -329,7 +329,11 @@ function add_twig_filters(\Twig\Environment $twig) 'json_tag', function(\mtgMetaField $field): string { $tag = get_field_alias_or_name($field); - return $tag.',string'; + $type = $field->getType(); + if($type instanceof \mtgBuiltinType && !$type->isString() && !$type->isBlob()) { + return $tag.',string'; + } + return $tag; } )); }