I have a lot of HTML tags that are hardcoded inside my code as strings. I want to move them into a separate module so that i can use them as variables instead.
When i am parsing the object using JSON.parse(HTMLTags) i am getting an error
Unexpected token x in JSON
I know that is because the double quotes and i know that i can escape them using backslash. but this too much to do because they are a lot of tags. is there any other way ?
export const HTMLTags = `{
"h1s": {
"greating1": "<h1 id="ms1" class="ms">ABC</h1>",
"greating2": "<h1 id="ms2" class="ms">XYZ</h1>",
.
.
.
.
.
"greatingx": "<h1 id="msX" class="ms">QWE</h1>"
}
}`;