Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaped double quotes are displayed as escaped #121

Closed
hefroy opened this issue May 30, 2020 · 4 comments · Fixed by #122
Closed

Escaped double quotes are displayed as escaped #121

hefroy opened this issue May 30, 2020 · 4 comments · Fixed by #122
Labels

Comments

@hefroy
Copy link

hefroy commented May 30, 2020

It's necessary to escape double quotes when they are contained in actions (or state names). However the escaping is currently being rendered rather than un-escaped.

Expected Behavior

The escaped double quotes are changed to double quotes.

Current Behavior

The escaped double quotes are displayed as escaped double quotes.

Possible Solution

The escaping should be stripped.

Steps to Reproduce

a -> b : "/call_function_with_string(\"a string\");";

Context

It's possible the action is calling a function with a string argument.

Your Environment

https://state-machine-cat.js.org/
Version: 7.0.2

@sverweij sverweij added the bug label May 30, 2020
@sverweij
Copy link
Owner

@hefroy thanks for finding & reporting this! Fix is on its way.

@sverweij
Copy link
Owner

@hefroy I've deployed a new version on live (https://state-machine-cat.js.org) in which this issue is fixed - npm will follow suit in about 5 minutes.

=> Could you let me know in case this doesn't solve your issue?

@hefroy
Copy link
Author

hefroy commented May 30, 2020

Hi @sverweij, thanks for the very fast response! Glad to help out, I really like what you've done here.
Yep, your fix looks good to me!

@hefroy
Copy link
Author

hefroy commented May 31, 2020

One last thought about this one: do you think it's worth mandating that the escape character '\' is also escaped? About the only reason to do would be for when you have a '\' character at the end of your action string, which will probably never be the case, apart from a weird comment such as:

a -> b : "my_action(); // Here's a bat emoji /|\ ^._.^ /|\";

But it probably isn't worth making users do this for such a slim use-case. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants