Closed MartinoMensio closed 4 years ago
That's an interesting case. The problem is that the parser chomps whitespace when it thinks it is outside a quoted string (which is caused by the ""
)...
It should be fixable. I have a deadline coming up March 1st, and I'll take a look at this afterwards.
Here's a hack you could try in the meantime: use the regex [a-zA-Z]\s[a-zA-Z]
to replace all spaces with a special symbol, either unicode or a long string like THISISREALLYASPACE
. Then, run through the parser to get clean JSON. Finally, replace that symbol with a space. This won't catch spaces between non-characters, but it should fix a lot of cases without breaking the JSON.
Thanks I will try that temporary workaround!
I have a little problems with a specific instance. I tried it in the web demo and it concatenates the words that are inside the unescaped quotes (see the "claimReviewed")
Input:
Output:
First of all: this package saved me tons of hours! 🥇