As a brasophile in the comments , the ideal is to prevent this wrong string from entering JSON in the first place. Dealing with the problem after the fact is much more difficult ...
If your JSON has exactly this format, just take everything inside the string and do a replace:
var string = '{"text": "Olha "eu" aqui"}';
var prefixo = '{"text": "';
var sufixo = '"}';
var conteudo = string.substring(prefixo.length, string.length-sufixo.length);
var novaString = prefixo + conteudo.replace(/"/g, '\"') + sufixo;
If you do not have it, you're having problems ... How to interpret the string below?
{"text":"b","c":"d"}
Key: text
, value: b
; key: c
, value d
? or:
Key: text
, value: b","c":"d
?
That is, the only correct solution is to deal with the problem before the string stops at JSON. If you have, for example, a legacy file where - for a bug - the format went wrong that way, you can even use an automated process to help you fix it, but you have to review it by hand ... Now, if it is an existing code that is generating this type of string, this code is bugged and you should correct it in source - and not apply a "band aid" ...