Declaring
text = '{"section": "\main" }'
results in
"{"section": "main" }"
Is there a way to prevent the Javascript interpreter from treating the backslash as an escape character and removing it?
I want to be able to declare "{"section": "\main" }" and keep the backslash in the output"
"{"section": "\main" }"
Note: I realise that if I use two backslashes it will give me the desired output. But I don't want to use two backslashes as I have a lot of Latex code that I am including in a webpage and it is extremely awkward having to double escape everything. So is there a way to prevent Javascript escaping text?
`\main`is escaped just like"\main"