2👍
✅
The reason why it breaks is because you are not escaping the new line character.
i.e., instead of this:
var starting_point = '# fourthwhat is this?
;o
how bout dat. ';
Your code should look like this:
var starting_point = '# fourthwhat is this? \
;o \
how bout dat. ';
So, if you’re getting the markdown string from an external, dynamic source, you’ll have to add the \
character before each line break.
EDIT: alternatively, you could just use the backtick operator (`):
var starting_point = `# fourthwhat is this?
;o
how bout dat. `;
Source:stackexchange.com