Closed tonijarjour closed 1 year ago
Example code:
const sayHello = (name) => { return `Hello ${name} Hello`; } console.log(sayHello("Bla \n Bla"));
I am processing this and outputting it to valid JSX. Only issue is string fragments are parsed, but template string fragments are not.
Output:
<span className="ts_template_string_punctuation">`</span> <span className="ts_template_substitution_punctuation">{"${"}</span> <span className="ts_template_substitution_identifier">name</span> <span className="ts_template_substitution_punctuation">{"}"}</span> <span className="ts_template_string_punctuation">`</span>
<span className="ts_string_punctuation">"</span> <span className="ts_string_string_fragment">Bla </span> <span className="ts_string_escape_sequence">\n</span> <span className="ts_string_string_fragment"> Bla</span> <span className="ts_string_punctuation">"</span>
Example code:
I am processing this and outputting it to valid JSX.
Only issue is string fragments are parsed, but template string fragments are not.
Output: