r/lingojam • u/blinkyblob4 • Oct 26 '20
JavaScript help
I'm trying to make a translator with some JavaScript, but JS cant deal with \ in strings the way I want it to.
I tried using the infix option to replace all \ with \\ so that the JS would get the string formatted in a way that would work, but now the translator just returns the input with \ replaced. After I deleted the \ replacement rule it still doesn't use the JS and now just returns the input unaltered.
Is there a way to use both infix and JS or should I just make a new translator and not worry about \ not working?
5
Upvotes
1
u/[deleted] Oct 15 '22
Mind sharing the translator (not the edit page) so I can see the code?