Last hyperlink dropped

0 votes
asked Jul 23, 2014 in Bug by fred (540 points)

Hello,

The following bug may appear in other diagrams/contexts, but was spotted in state diagram.

With the following code, the hyperlink does not show up:

@startuml
A: [[B]]
@enduml
 
In the following case, the C hyperlink does not show up:
 
@startuml
A: [[B]] [[C]]
@enduml
 
It seems that the last hyperlink gets dropped.
 
A workaround is to add an additional (possibly empty) hyperlink at the end, such as in:
 
@startuml
A: [[B]] [[]]
A: [[B]] [[C]] [[]]
@enduml

 

Best regards,

Fred

commented Jul 24, 2014 by fred (540 points)
Hello,

To complement this report: the behavior is even stranger for use cases.

@startuml
rectangle "[[B]]" as BA
rectangle "[[B]] [[C]]" as CA
rectangle "[[B]] [[]]" as B
rectangle "[[B]] [[C]] [[]]" as C
@enduml

When rendering this figure to PNG, we also observe that the last link is left out. The workaround consisting of adding an additional link works.

However, no text shows up when rendering to SVG.
By looking at the SVG code, one can see that all the links except the last are actually nested into the last. This is incorrect. However, I am not sure why no text is rendered at all.

2 Answers

0 votes
answered Jul 24, 2014 by plantuml (298,440 points)
Ok, many thanks for these detailed reports.

We'll have a look on it.

Regards,
0 votes
answered Jul 25, 2014 by plantuml (298,440 points)

Ok, here we have a mix of bugs and not-very-documented features.

Anyway, here is a corrected version : https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

(Few tests has been done, so thanks for feedbacks).

About undocumented feature, you should know that historically, hyperlink support was partial in PlantUML.
When a hyperlink was given by a user, it was applying to the whole line. And this is sometimes usefull like in:

@startuml
class foo {
  +My Method [[link1]]
  +Another one [[link 2]]
}
@enduml

http://www.plantuml.com/plantuml/svg/Iyv9B2vMIClFLwZcKb3GzgrKy4qjoSXFKOYEpidCopQCZGK9E-RbbsIa5YdavwL29HICW3Ar0000

In that case, the hyperlink apply to the method, and is not printed.

Latter, we have decided to support hyperlinks anywhere in texts, while trying to support the "old" behaviour.

Obviously, what we used to provide has some bugs.

So we hope that this is fixed now : please tell us!

Regards, and thanks for your tests

...