From 42d66b6a399ec4f557c5653e49b65b4e906faee0 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 27 Jan 2020 15:44:27 +0100 Subject: [PATCH] Fix parsing of " in RfC output --- app/views/request_for_comments/show.html.slim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/request_for_comments/show.html.slim b/app/views/request_for_comments/show.html.slim index 6b49f216..0afd1055 100644 --- a/app/views/request_for_comments/show.html.slim +++ b/app/views/request_for_comments/show.html.slim @@ -40,7 +40,8 @@ - output_runs.each do |testrun| - output = testrun.try(:output) - if output - - messages = output.scan(/{(?:(?:".+?":".+?")+?,?)+}/) + // (?:\\"|.) is required to correctly identify " within the output. + - messages = output.scan(/{(?:(?:"(?:\\"|.)+?":"(?:\\"|.)+?")+?,?)+}/) - messages.map! {|el| JSON.parse(el)} - messages.keep_if {|message| message['cmd'] == 'write'} - messages.map! {|message| message['data']}