From c8060d453b9ed839b7823860087d12db7a831d82 Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Sun, 15 Oct 2023 13:37:50 +0900 Subject: [PATCH] fix: fixed output json error of ScriptBlockText value when ScriptBlockText is empty #1189 --- src/afterfact.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/afterfact.rs b/src/afterfact.rs index 0fd14b484..c6e32530b 100644 --- a/src/afterfact.rs +++ b/src/afterfact.rs @@ -1581,9 +1581,9 @@ pub fn output_json_str( output_stock.push(format!(" \"{key}\": {{")); }; for (idx, contents) in details_target_stock.iter().enumerate() { - let (key, value) = contents.split_once(": ").unwrap_or_default(); + let (key, value) = contents.split_once(':').unwrap_or_default(); let output_key = _convert_valid_json_str(&[key], false); - let fmted_val = _convert_valid_json_str(&[value], false); + let fmted_val = _convert_valid_json_str(&[value.trim_start()], false); if idx != details_target_stock.len() - 1 { output_stock.push(format!(