dotnet-state-machine / stateless

A simple library for creating state machines in C# code
Other
5.62k stars 767 forks source link

Escape labels in `UmlDotGraphStyle` #597

Open nightroman opened 3 months ago

nightroman commented 3 months ago

UmlDotGraph does not escape special characters like " and \ in state, trigger, description labels. As a result, the generated DOT is invalid when such labels exist.

This is not a big deal perhaps when labels are carefully selected in order to work around this issue. But state machines may be dynamically created from data/strings not originally designed with Stateless and this issue in mind.

This PR includes:

P.S. I hit this issue with real use cases on making state machines in PowerShell for using with FarNet.Stateless.

nightroman commented 1 month ago

Any feedback please? If it's not being addressed, I'd rather close the PR than have it in my TODO list...

crozone commented 1 month ago

Hi @nightroman, just getting around to reviewing this, thanks for the bump. It might take a day or two.