fix clean json response

This commit is contained in:
2026-07-03 12:24:40 +07:00
parent 8a4e882dc1
commit 08f19f17a2
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
name = "GeneralUtils" name = "GeneralUtils"
uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe" uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe"
version = "0.4.4" version = "0.4.5"
authors = ["tonaerospace <tonaerospace.etc@gmail.com>"] authors = ["tonaerospace <tonaerospace.etc@gmail.com>"]
[deps] [deps]
+6 -4
View File
@@ -545,10 +545,12 @@ julia> clean_json_response(text)
``` ```
""" """
function clean_json_response(text::String) function clean_json_response(text::String)
text = replace(text, '{' => "") removelist = ["{", "}", "```", "json"]
text = replace(text, '}' => "") for i in removelist
text = replace(text, "```" => "") while occursin(i, text)
text = replace(text, "json" => "") text = replace(text, i => "")
end
end
text = '{' * text * '}' text = '{' * text * '}'
return text return text
end end