Closed NeroBlackstone closed 4 months ago
This is just julia string parsing. The \"
in your string literal resulted in just a "
.
julia> using JSON
julia> json = """
{
"contents": "While \u003Ca href=\"https://www.pcgamer.com/uk/search/?searchTerm=team+fortress+2\" "
}
""";
julia> json2 = """
{
"contents": "While \u003Ca href=\\"https://www.pcgamer.com/uk/search/?searchTerm=team+fortress+2\\" "
}
""";
julia> println(json)
{
"contents": "While <a href="https://www.pcgamer.com/uk/search/?searchTerm=team+fortress+2" "
}
julia> println(json2)
{
"contents": "While <a href=\"https://www.pcgamer.com/uk/search/?searchTerm=team+fortress+2\" "
}
julia> JSON.parse(json)
ERROR: Expected ',' here
Line: 1
Around: ...<a href="https://www.pcgamer.c...
^
Stacktrace:
<......>
julia> JSON.parse(json2)
Dict{String, Any} with 1 entry:
"contents" => "While <a href=\"https://www.pcgamer.com/uk/search/?searchTerm=tea…
Then throw a error:
Why? I think this is a validated json string.