Skip to content

Linebreak in $label breaks font relationship styling #255

Closed
@Potherca

Description

@Potherca

When a newline/linebreak is present in the $label of a relationship, the styling breaks.

@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/v2.4.0/C4_Container.puml

Container(a, "A")
Container(b, "B")
Container(c, "C")
Container(d, "D")

Rel(a, b, "Relation1 Relation2")
Rel(c, d, "Relation1\nRelation2")
@enduml

The user can remedie this by adding the "closing" and "opening" creole markers themselves before and after the newline **\n**:

@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/v2.4.0/C4_Container.puml

Container(a, "A")
Container(b, "B")

Rel(a, b, "Relation1**\n**Relation2")
@enduml

But to me, this feels like a hack.

To fix this, we could parse the label to replace \n with **\n**, but that might be more work than its worth.
Alternatively, we could use HTML instead of Creole syntax, or employ a stereotype:

@startuml
(A) -> (B) : <b>Relation1\nRelation2

skinparam ArrowFontStyle<<bold>> bold

(C) -> (D)<<bold>> : Relation1\nRelation2
@enduml

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions