Given a String like str = “\“ and then rendering it into some other program like JS or Python:
# index.js.eex
console.log(„<%= str %>“)
# hello.py.eex
print(„<%= str %>“)
results in console.log(„\“)
You see the problem the backslash will escape the closing quote and produce a syntax error in JS
The question is, How should I fix it?
PS: I am writing it on a mobile phone, so the quotes are not correct, will fix it as soon I am on my laptop