jiphy icon indicating copy to clipboard operation
jiphy copied to clipboard

single-quotes inside strings

Open z33kz33k opened this issue 4 years ago • 0 comments

It seems jiphy does not escape quotes in strings properly. Is this correct? I'm using jiphy inside Python code (to.python() and to.javascript() methods).

Example in Python: some_dict = {"name": "AppWrapper.some_function(var_name='Some_Var_Name')"}

Then this dict gets translated to JS with: jiphy.to.javascript(repr(some_dict))

And the result is: {'name': 'AppWrapper.read_env_var(var_name='Some_Var_Name')'}

which is invalid, because browser will interpret the inside quotes as starting a new string which is not the case.

Any solutions barring regexing it?

z33kz33k avatar Apr 16 '20 10:04 z33kz33k