Broken diagram with nested rectangles and remove @unlinked

0 votes
asked Jun 22, 2021 in Bug by anonymous

Hello - 

I have a large diagram with several nested rectangles.   I then added the ability to only link certain sections of the diagram and use "remove @unlinked" to trim down what is rendered.  When using this, I get an error when attempting to render the diagram with version 1.2021.4 (via Kroki).

I've simplified the diagram down to a base case to reproduce this issue:

@startuml Broken

rectangle "==Outer 1" as o1 {

rectangle "==Outer 2" as o2 {

rectangle "==Inner" as inner

}

}

rectangle "a" as a

rectangle "b" as b

a -> b

remove @unlinked

@enduml

commented Jun 22, 2021 by The-Lu (64,760 points)

Hello A.,

See similar defect here:

Then, a workaround is to add dummy void element, as:

@startuml
rectangle "==Outer 1" as o1 {
[void]
remove void
rectangle "==Outer 2" as o2 {
rectangle "==Inner" as inner
}
}

rectangle "a" as a
rectangle "b" as b
a -> b

remove @unlinked
@enduml

If that can help,
Regards,
Th.

1 Answer

0 votes
answered Aug 23, 2021 by plantuml (295,000 points)
...