Issue : Parsing Json Front Matter doesn't accept special characters between double quotes

Hi,

I’ve an issue with the hugo jSon parser
"coordinates":[ "_lw|GawlI\bBfKoW_G{I_LrHxCpN~AF" ]send me an error :unable to read frontmatter at filepos`

In my view between two quotes "" the string should accept specials characters

a part of my json

{"geometry":{
            "geoJson":{
                "type":"FeatureCollection",
                "features":[
                    {
                        "type":"Feature",
                        "geometry":{
                            "type":"PolygoneEncoded",
                            "coordinates":[
                                "_lw|GawlI\bBfKoW_G{I_LrHxCpN~A`F"
                            ]
                        },
                        "properties":{
                            "popup":{
                                "title":"3e Rac",
                                "description":"1 voisin(s)",
                                "action":{
                                    "target":"",
                                    "text":""
                                }
                            },
                            "token":"ac35b49b425bc36e6b65ab4eddc82737",
                            "referencer":{
                                "selfname":"network",
                                "token":"d016b01745346fb8cdb425ded06dd702"
                            },
                            "type":"network.neighbors",
                            "location":null
                        }
                    }
                ]
            }
        }
    }


I hope you understand my «froggy english» :slightly_smiling:

Thanks

You have to escape \ -> \\
\b, \n etc. are special ascii characters (backspace, return…).

yes i know the fix but in my view i think it’s a bug, because jSon Hugo parser should parse the string between the double quote.

Hugo uses the Go parser, so any issues with this should be reported here:

1 Like

Indeed
https://play.golang.org/p/INLuBGyc6A

1 Like