Newline in state diagrams is inconsistent

0 votes
asked Feb 8 in Bug by sashee (160 points)

I'm having trouble figuring out how to use newlines in state diagram bodies (not in the name of the states). It used to work using \n\, but it seems to be changed now.

Also, I'm experiencing inconsistent behavior.

This shows several lines:

But when I remove the inner state, the newlines are broken:

What is the proper way to add multiple lines? If I use s1: multiple times it outputs multiple lines, but then I can't use leading whitespace. Example:

commented Feb 9 by Martin (5,640 points)
edited Feb 9 by Martin

How strange [that removing the inner state changes the parsing such].

Here's an ugly workaround by coding the character code for a space in the first position.

state s1
s1 : line1
s1 : <U+0020> line2
s1 : <U+0020>   line3

Oddly \t works(!) and you could set tabsize to 2:

skinparam tabSize 2
state s1
s1 : line1
s1 : \tline2
s1 : \t\tline3

1 Answer

0 votes
answered Feb 10 by plantuml (262,900 points)

Many thanks for the report, and sorry about the regression.

This is fixed in last beta and on the online server.

(Caution, there might be some cache issues with the online server)

Tell us if you find other issues!