From 4cb34a611d82affd0d1ae7baeeaf26c07c8bc239 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Wed, 28 Oct 2020 01:15:33 +0100 Subject: [PATCH] Allow empty string values to be matched --- app/views/request_for_comments/show.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/request_for_comments/show.html.slim b/app/views/request_for_comments/show.html.slim index e3032682..d5cca4a3 100644 --- a/app/views/request_for_comments/show.html.slim +++ b/app/views/request_for_comments/show.html.slim @@ -45,7 +45,7 @@ - Timeout::timeout(2) do // (?:\\"|.) is required to correctly identify " within the output. // The outer (?: |\d+?) is used to correctly identify integers within the JSON - - messages = output.scan(/{(?:(?:"(?:\\"|.)+?":(?:"(?:\\"|.)+?"|\d+?|\[.*?\]))+?,?)+}/) + - messages = output.scan(/{(?:(?:"(?:\\"|.)+?":(?:"(?:\\"|.)*?"|\d+?|\[.*?\]))+?,?)+}/) - messages.map! {|el| JSON.parse(el)} - messages.keep_if {|message| message['cmd'] == 'write'} - messages.map! {|message| message['data']}