Error when inserting square brackets in an activity (beta)

0 votes
asked Jul 17, 2020 in Bug by Aurélien
Hello,

When I insert square brackets in an activity that is splitted in several lines, I've got an error during the diagram generation:

for example:

@startuml
start

:start[i]
next line;

stop
@enduml

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuG8pkBYim7HqPYnNNcf5YK9EPbwgDHTGCh-0oo4rBmMe4W00
commented Jul 17, 2020 by Martin
edited Jul 17, 2020

The problem is that "]" is an alternative terminator to ";" that produces square corners rather than rounded ones.  You would get a similar problem if you wanted the first line to end with any of the other terminators: ; | < > / ] } (see https://plantuml.com/activity-diagram-beta section SDL)

A workaround is to make sure the "]" isn't the last character on an intermediate line.

E.g. Here I add a bold space after the "]".  I  also changed the final ";" to a "]" to demonstrate that behaviour also.

@startuml
start
:start[i]<b> </b>
next line]
stop
@enduml

draws as:

http://www.plantuml.com/plantuml/png/SoWkIImgAStDuG8pkAp0L7Hch4sIdOADVf8TLrvgHOb2JcPUQYnGINu1bqDgNWfGFG00

I expected to be able to escape the "]" with "\]" but that didn't work. 

Note the neater solution below using single line notation and "\n".

1 Answer

0 votes
answered Jul 17, 2020 by The-Lu (64,340 points)

Hello A.,

That is the current behavior;
See quasi similar defect here: https://forum.plantuml.net/11519/issues-final-separator-repeating-final-separator-activity

A possible workaround is to put all on one line with '\n', like:

@startuml
start

:start[i]\nnext line;

stop
@enduml


[Click to see on PlantUML server]

[And just for fun, if we double the bracket that is OK !!!! (see https://forum.plantuml.net/11519)


[click to see on PlantUML server]

]

If that can help,
Regards,
Th.

...