I have multiple languages in dotCMS. Language variables may contain single quotes or double quotes. I get access to this variables in my javascript by wrapping them in quotes.
var text = "$text.get('variable_name')";
But if variable contains the same quotes, js code crashes. Regular expretions also dont's not work when variable contains /. I use es5, so template string is not an option.
How can I solve this problem?