Strip a single leading/trailing markdown code fence from pasted text, if present,
before it gets handed to JSON.parse. Tolerates both language-tagged fences
(json ... ) and bare fences (...), plus surrounding whitespace/
newlines around the fence markers and the enclosed content. If no fence wraps
the whole text, the input is returned unchanged (verbatim raw-JSON paste is
still fully supported).
Strip a single leading/trailing markdown code fence from pasted text, if present, before it gets handed to JSON.parse. Tolerates both language-tagged fences (
json ...) and bare fences (...), plus surrounding whitespace/ newlines around the fence markers and the enclosed content. If no fence wraps the whole text, the input is returned unchanged (verbatim raw-JSON paste is still fully supported).