Style does not work work for sub-diagram

0 votes
asked Apr 7, 2022 in Bug by Giovanni Biscuolo

Hello,

I'm trying to apply <style> to a sub-diagram following this example:

This is my first attempt, in which styles are not applied and Plantuml rendering gives an error:

This is the error: "error on line 1 at column 678: error parsing attribute name"

This is the source (with diagram preview working):

http://www.plantuml.com/plantuml/uml/TOx1IWCn48RlUOgS2ztSwwKWwCMReeTIokmcReTDCc5cKYcbx-Ax-6Acou8eU0cPVxxv_tyh2gmrHICJvW8CoJvGrdkAn9Q3Dnlx4aJDvP8m-mJbNt1bqOUig5-VzeI29p2hbTtjZgf5Div1JrMx4JL2tmsKt16oxuacbu2de9X7Dn0NOj2m_j5wRjmQ1csEYfGNGRIzm5wSVKHzWdw__vttJZNx-QBxm0bJy0WTyUXkatj5gH0FI-NpOQpj6p47iMzjNsxqNySvk9CgOUw_z3YBXcIVczhuwzNScMt8lgRu3G00

If I try to move <style> into the mindmap sub-diagram I get an error:

http://www.plantuml.com/plantuml/uml/TOx1IWCn48RlUOgS2ztSwwKWwCMReeTIokmcReTDCc5cKYcbx-Ax-6Acou8eU0cPVxxv_tyh2gmrHICJvW8CoJvGrdkAn9Q3Dnlx4aJDvP8m-mJbNt1bqOUig5-VzeI29p2hbTtjZgf5Div1JrMx4JL2tmsKt16oxuacbu2de9X7Dn0NOj2m_j5wRjmQ1csEYfGNGRIzm5wSVKHzWdw__vttJZNx-QBxm0bJy0WTyUXkatj5gH0FI-NpOQpj6p47iMzjNsxqNySvk9CgOUw_z3YBXcIVczhuwzNScMt8lgRu3G00

This is the text of the error:

PlantUML 1.2022.4beta1[From string (line 10) ] @startuml: Sub-diagram Test {{mindmap<style>mindmapDiagram {.green {BackgroundColor lightgreen}.rose {Syntax Error?

Please is this a bug or there is something I miss here?

Thanks! Giovanni

commented Apr 7, 2022 by Martin (8,360 points)

Yep, looks like a bug with parsing curly brackets to me:

commented Apr 7, 2022 by Martin (8,360 points)

Note that if you are using Plantuml.jar locally, then the following will work:

@startuml
skinparam FontColor red
: Test
{{
@startmindmap
<style>
mindmapDiagram {
  .green {
    BackgroundColor lightgreen
  }
  .rose {
    BackgroundColor #FFBBCC
  }
  .your_style_name {
    BackgroundColor lightblue
  }
}
</style>
* identità visiva <<green>>
** [[https://about.gitlab.com/handbook/marketing/corporate-marketing/brand-activation/brand-standards/ GitLab]]
** [[https://foundation.wikimedia.org/wiki/Visual_identity_guidelines Wikipedia]]
** [[https://brand.suse.com/brand-system Suse]]
@endmindmap
}}
;
@enduml

But the online server does not support nested "@" directives.

commented Apr 7, 2022 by The-Lu (64,340 points)

Hello G.,

Yes, there are some bugs...

Here are some minimal examples:

First, with empty style, OK:

@startuml
:Test 
{{mindmap
<style>
</style>
* a
** b1
** b2
}};
end
@enduml

Then, with a minimal style, KO:

@startuml
:Test 
{{mindmap
<style>
root {
  FontColor: red
}
</style>
* a
** b1
** b2
}};
end
@enduml

Other OK example, on deployment diagram:

@startuml
node n [
{{mindmap
<style>
root {
  FontColor: red
}
</style>
* a
** b1
** b2
}}
]
@enduml

FYI, see export on SVG, the SVG are malformed!

This page contains the following errors:
error on line 2 at column 504: error parsing attribute name

If that can help, for the correction...
Regards.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...