From 48339a10767357d9b46eb682eb124d19ad4bcfd1 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 14 Feb 2024 21:05:20 +0200 Subject: [PATCH] fix nl2br filter --- src/Twig/AppExtension.php | 4 +--- templates/default/main/index.html.twig | 2 +- templates/default/main/namespace.html.twig | 2 +- templates/default/main/transaction.html.twig | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index 2cc1a15..dc1d6bc 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -92,9 +92,7 @@ class AppExtension extends AbstractExtension case \Kvazar\Index\Manticore::TYPE_STRING: - return nl2br( - $value - ); + return (string) $value; case \Kvazar\Index\Manticore::TYPE_BIN: diff --git a/templates/default/main/index.html.twig b/templates/default/main/index.html.twig index f2899b1..7b43ebc 100644 --- a/templates/default/main/index.html.twig +++ b/templates/default/main/index.html.twig @@ -27,7 +27,7 @@ {{ record.key | format_type(record.type.key) }}
- {{ record.value | format_type(record.type.value) }} + {{ record.value | format_type(record.type.value) | nl2br }}
{{ record.time | format_date }} {{ 'in' | trans }} {{ record.block }} diff --git a/templates/default/main/namespace.html.twig b/templates/default/main/namespace.html.twig index 86728db..07e3a61 100644 --- a/templates/default/main/namespace.html.twig +++ b/templates/default/main/namespace.html.twig @@ -28,7 +28,7 @@ {{ record.key | format_type(record.type.key) }}
- {{ record.value | format_type(record.type.value) }} + {{ record.value | format_type(record.type.value) | nl2br }}
{{ record.time | format_date }} {{ 'in' | trans }} {{ record.block }} diff --git a/templates/default/main/transaction.html.twig b/templates/default/main/transaction.html.twig index 9e9fa0b..402d117 100644 --- a/templates/default/main/transaction.html.twig +++ b/templates/default/main/transaction.html.twig @@ -28,7 +28,7 @@ {{ record.key | format_type(record.type.key) }}
- {{ record.value | format_type(record.type.value) }} + {{ record.value | format_type(record.type.value) | nl2br }}
{{ record.time | format_date }} {{ 'in' | trans }} {{ record.block }}