JSFiddle - React, Tailwind, and code Playground
HTML
<script id="jsontest" type="text/json">
{
"adlibJSON": {
"recordList": {
"record": [
{
"@attributes": {
"priref": "4372",
"created": "2011-12-09T23:09:57",
"modification": "2012-08-11T17:07:51",
"selected": "False"
},
"acquisition.date": [
"1954"
],
"documentation.title": [
"A lot of text with a lot of extra double quotes like "this" and "this""
] ... ...
</script>
CSS
body {font-family: monospace; white-space: pre }
JavaScript
var json = document.getElementById('jsontest').innerHTML;
var fixedjson = json.replace(/(^\s*|:\s*)"/gm, '$1[sentinel]')
.replace(/"(,?\s*$|:)/gm, '[sentinel]$1')
.replace(/"/g, '\\"').replace(/\[sentinel\]/g, '"');
document.write(fixedjson);