0

I just want to store the markdown text in a JSON string. Is it ok for me to simply copy the text into the string or do I have to manually escape certain characters?

I know that JSON uses certain characters for formatting and I would like to know what characters would be in conflict.

What characters do I need to escape?

Thanks!

Blaze349
  • 429
  • 1
  • 5
  • 16

1 Answers1

3

You should be fine to copy/paste. You will need to escape quotes with \", tabs with \t and backslashes with \\.

Kyle Berezin
  • 597
  • 4
  • 20
  • 4
    [JSON doesn't support multi-line strings, so newlines will have to be converted as well](https://stackoverflow.com/questions/2392766/multiline-strings-in-json). – ChrisGPT was on strike May 28 '17 at 21:38