[BUG] Escape chars in textinput options are passed to module callbacks as string literals #3316
Open
2 tasks done
Labels
BUG
Something isn't working
Is this a bug in companion itself or a module?
Is there an existing issue for this?
Describe the bug
See prior discussion here and related issue here
Escape chars such as
\n
are not replaced (regardless of if passed throughparseVariablesInString
) with the characters they represent.Steps To Reproduce
Use the ember plus module to connect back to companion and set the button text with the set value string action to:
test\n123
Use ember+ viewer to confirm the value of this ember plus path, it will be
test\n123
I have been able to send an actual newline char by appending a
.replaceAll('\\n','\n')
to the string in the ember plus action call back.Expected Behavior
Unclear if this is the expected behavior.
I think the escape strings should be replaced with the characters they represent when passed to module callbacks. The same as if a variable in JS/TS was assigned the value of
test\n123
and that the currently returned string should require an input fortest\\n123
. However I appreciate that if this behavior has been consistent for some time 'fixing' this make cause unintended breakages elsewhere.If that is the case (ie this is the expected behavior / won't fix) perhaps a method can be added to
companion-module-base
to perform this substitution in a consistent manner for all modules that require it.Environment (please complete the following information)
Additional context
No response
The text was updated successfully, but these errors were encountered: