-
Notifications
You must be signed in to change notification settings - Fork 1.1k
It is not possible to activate all PlantUML elements with "ENABLE_ALL_PLANT_ELEMENTS". New PlantUML server versions produce an error. #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The problem is that the "style" supports no %newline() anymore ("skinparam" are fixed in the meantime and works again). @startuml
!ENABLE_ALL_PLANT_ELEMENTS = 1
!function $nl()
' workaround
' !return %breakline()
!return %newline()
!endfunction
!function $elementTagSkinparams($element, $tagStereo, $fontColor)
!$elementSkin = "skinparam " + $element + "<<" + $tagStereo + ">> {" + %newline()
!if ($fontColor != "")
!$elementSkin = $elementSkin + " StereotypeFontColor " + $fontColor + %newline()
!$elementSkin = $elementSkin + " FontColor " + $fontColor + %newline()
!endif
!$elementSkin = $elementSkin + "}" + %newline()
!return $elementSkin
!endfunction
' label colors cannot be set via skinparam use style
!function $labelElementTagSkinparams($tagStereo, $bgColor)
!$tagSkin = $nl() + "<style>" + $nl()
' componentDiagram {
!$tagSkin = $tagSkin + " label {" + $nl()
!$tagSkin = $tagSkin + " ." + $tagStereo + " {" + $nl()
!$tagSkin = $tagSkin + " StereotypeFontColor " + $bgColor + $nl()
!$tagSkin = $tagSkin + " Fontcolor " + $bgColor + $nl()
!$tagSkin = $tagSkin + " }" + $nl()
!$tagSkin = $tagSkin + " }" + $nl()
' }
!$tagSkin = $tagSkin + "</style>" + $nl()
!return $tagSkin
!endfunction
!unquoted procedure $defineSkinparams($tagStereo, $bgColor, $fontColor)
' skinparam works based on updated server implementation
!$tagSkin = $elementTagSkinparams("rectangle", $tagStereo, $fontColor)
!$tagSkin = $tagSkin + $elementTagSkinparams("package", $tagStereo, $fontColor)
' style does not work, %newline() is not supported anymore
!$tagSkin = $tagSkin + $labelElementTagSkinparams($tagStereo, $bgColor)
$tagSkin
!endprocedure
$defineSkinparams("red", white, red)
$defineSkinparams("blueboundary", white, blue)
$defineSkinparams("bluelabel", blue, white)
[C]
rectangle r <<red>> {
}
label "LABEL" as l <<bluelabel>>
package p <<blueboundary>> {
}
@enduml If I replace the %newline() in the styles with the new %breakline() the it works with the new PlantUML version too. !function $nl()
' workaround
!return %breakline()
' !return %newline()
!endfunction I reported in forum an issue for that. |
Thank you for the report. I'm a bit confused about the following stack trace entries:
The reason is that there is no line 112 in Also, I cannot reproduce the crash, the following example works fine on my side: |
Hi @arnaudroques, thank you for your fast response (and sorry for my delay). If I try to open following link then I cannot display it on the server (using %newline()) If I replace it with %breakline() and display the %version() then you see it is a 1.1025.3beta5 server I tried it locally on my windows version with the MIT version "plantuml-mit-SNAPSHOT-v1.2025.3beta5.jar" (from 30.3.) too, and it was not working. I attached my puml and the console log too: TODO.puml.txt (please remove txt extension) I tried it with ".\plantuml-mit-1.2025.2.jar " too, same exception. ============ Now I tried a simpler sample, I think it shows the problem in the UI with the %newline() (but without exception):
============= With this script I can reproduce it with %newline() and %breakline(). For me it looks like that the problem is that 2 variables are combined (tested it with ex. .\plantuml-mit-1.2025.2.jar produces the same state exception; only changed lines in SourceFileReaderAbstract class).
Or you can see the illegal state exception on server too BR Helmut PS.: can we switch to the forum? https://forum.plantuml.net/19921/combination-styles-3beta4-%25newline-older-version-working |
No problem, I have answered on the forum. |
The "Sample with PlantUML elements" sample in the LayoutOptions.md section is not working anymore (ex. PlantUML version 1.2025.4beta3).
If "!ENABLE_ALL_PLANT_ELEMENTS = 1" is set then it produces an error like below:
If the options is not activated then it works without any problem ("only" the style is not correct):
The problem is the changed "\n", "%newline()" handling in the new PlantUML versions.
The text was updated successfully, but these errors were encountered: