From 8cf053e3ac7ed10363ded43c0c61c54d756b43cf Mon Sep 17 00:00:00 2001 From: Trevor Morris Date: Fri, 27 May 2022 09:51:00 +0100 Subject: [PATCH] fix: issue with json and HTML causing invalid JSON (#190) --- resources/views/json.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/json.blade.php b/resources/views/json.blade.php index 5889b64..59ef3c7 100644 --- a/resources/views/json.blade.php +++ b/resources/views/json.blade.php @@ -20,8 +20,8 @@ "id": "{{ url($item->id) }}", "title": "{{ $item->title }}", "url": "{{ url($item->link) }}", - "content_html": "{!! str_replace('"', '\\"', $item->summary) !!}", - "summary": "{!! str_replace('"', '\\"', $item->summary) !!}", + "content_html": {!! json_encode($item->summary) !!}, + "summary": {!! json_encode($item->summary) !!}, "date_published": "{{ $item->timestamp() }}", "date_modified": "{{ $item->timestamp() }}", "authors": [{ "name": "{{ $item->authorName }}" }],