I am using JSON.parse for a list of products. I am running a regex to replace characters that were breaking the parse:
[\n|\t|\r]
It seems that I am still having issues when the following content is being copied into html.
<p><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial, Verdana, Helvetica; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">A soul mate for your aluminum group lounge chair. Rest your weary feet on this matching ottoman - same suspension design, same light weight, same elegant scale as the lounge chair. Polished aluminum 4-star base, black pedestal. Glides.</span></p>
Not sure which part is breaking the parser, and what I can do to fix it, short of removing the style and span tags.
You need to be more clear about exactly what steps you’re taking between obtaining that HTML as a string, what you do to make it “JSON”, and actually calling JSON.parse. Otherwise you’re making it look like you’re trying to use a JSON parser to parse HTML, which doesn’t make sense.
that said, my guess is that it’s the quote marks.