Closed The-Lum closed 1 year ago
I search what is broken...
The issue is on our side: we have completely rewritten the style parser. Don't waste any time: we are going to investigate.
Thanks for the report!
It has just been fixed. Some other themes may have also issues: could you tell us if you find any errors? Thanks!
Hi @arnaudroques, and all,
After rebuild all the Theme Gallery this morning, it is better. But we always see $4 \times$:
net.sourceforge.plantuml.style.parser.StyleParsingException: Cannot understand <
at net.sourceforge.plantuml.style.parser.StyleParser.parse(StyleParser.java:259)
at net.sourceforge.plantuml.style.parser.StyleParser.parse(StyleParser.java:61)
at net.sourceforge.plantuml.jsondiagram.StyleExtractor.applyStyles(StyleExtractor.java:116)
at net.sourceforge.plantuml.jsondiagram.JsonDiagramFactory.createSystem(JsonDiagramFactory.java:94)
at net.sourceforge.plantuml.PSystemBuilder.createPSystem(PSystemBuilder.java:140)
at net.sourceforge.plantuml.BlockUml.getDiagram(BlockUml.java:181)
at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:168)
at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:519)
at net.sourceforge.plantuml.Run.processArgs(Run.java:402)
at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:369)
at net.sourceforge.plantuml.Run.main(Run.java:204)
See Action Log here:
I search for which diagram that occurs...
And with this lines:
at net.sourceforge.plantuml.jsondiagram.StyleExtractor.applyStyles(StyleExtractor.java:116)
at net.sourceforge.plantuml.jsondiagram.JsonDiagramFactory.createSystem(JsonDiagramFactory.java:94)
That seems perhaps occurs with JSON or YAML diagram... (but I don't know with which theme
!)
Regards.
[Just for traceability]
FYI @bharatrajagopalan (initial author of the carbon-gray
theme [#1059, #1060])
See minor change/fix (to be conform with the new PlantUML style parser) on your theme here:
Regards.
Hi @arnaudroques,
Here is a complement:
style
is without effect on JSON
or YAML
diagram.See example on the corresponding doc pages. and here:
@startyaml
<style>
yamlDiagram {
node {
BackGroundColor lightblue
LineColor lightblue
FontName Helvetica
FontColor red
FontSize 18
FontStyle bold
BackGroundColor Khaki
RoundCorner 0
LineThickness 2
LineStyle 10;5
separator {
LineThickness 0.5
LineColor black
LineStyle 1;5
}
}
arrow {
BackGroundColor lightblue
LineColor green
LineThickness 2
LineStyle 2;5
}
}
</style>
-
name: Mark McGwire
hr: 65
avg: 0.278
-
name: Sammy Sosa
hr: 63
avg: 0.288
@endyaml
Thanks for your analyse and correction... Regards.
Hi @arnaudroques,
A line of research...
Just change
LineStyle 10;5
to
LineStyle 10-5
@startyaml
<style>
yamlDiagram {
node {
BackGroundColor lightblue
LineColor lightblue
FontName Helvetica
FontColor red
FontSize 18
FontStyle bold
BackGroundColor Khaki
RoundCorner 0
LineThickness 2
LineStyle 10-5
separator {
LineThickness 0.5
LineColor black
LineStyle 1-5
}
}
arrow {
BackGroundColor lightblue
LineColor green
LineThickness 2
LineStyle 2-5
}
}
</style>
-
name: Mark McGwire
hr: 65
avg: 0.278
-
name: Sammy Sosa
hr: 63
avg: 0.288
@endyaml
Regards.
Test by test...
Just adding an empty style... [and this is the drama]
<style>
</style>
Could you compare:
@startyaml
!theme amiga
-
name: Mark McGwire
hr: 65
avg: 0.278
-
name: Sammy Sosa
hr: 63
avg: 0.288
@endyaml
VS
@startyaml
!theme amiga
<style>
</style>
-
name: Mark McGwire
hr: 65
avg: 0.278
-
name: Sammy Sosa
hr: 63
avg: 0.288
@endyaml
Thanks for your work...
- How manage this [not backward compatible] change?
I'm afraid that this will be an exception where we are not going to be backward compatible.
This is because we are now fully supporting real CSS format:
<style>
yamlDiagram {
node {
BackGroundColor: lightblue;
LineColor: lightblue;
FontName: Helvetica;
FontColor: red;
FontSize: 18;
FontStyle: bold;
BackGroundColor: Khaki;
RoundCorner: 0;
LineThickness: 2;
LineStyle: 10-5;
separator {
LineThickness: 0.5;
LineColor: black;
LineStyle: "1;5";
}
}
arrow { BackGroundColor: lightblue; LineColor: green; LineThickness: 2; LineStyle: "2;5"; }
}
</style>
The legacy "close-to-CSS" format is also supported:
<style>
yamlDiagram {
node {
BackGroundColor lightblue
LineColor lightblue
FontName Helvetica
FontColor red
FontSize 18
FontStyle bold
BackGroundColor Khaki
RoundCorner 0
LineThickness 2
LineStyle "10;5"
separator {
LineThickness 0.5
LineColor black
LineStyle "1;5"
}
}
arrow {
BackGroundColor lightblue
LineColor green
LineThickness 2
LineStyle 2-5
}
}
</style>
So now LineStyle 10;5
is really too confusing for our parser, so you have to use LineStyle 10-5
or LineStyle "10;5"
I think it's an acceptable solution, since it only breaks the rendering, not the diagram itself (and only if LineStyle is used). Any though?
PS: Thanks about the <style></style>
issue, we're going to fix it also.
Hi,
<style></style>
issue performs the StyleParsingException: Cannot understand <
To be continued.
Last issue fixed by:
Thanks, 👍 I can continue to improve theme...
See also question (about styler parser
) here:
Hello @arnaudroques, and all,
With the update of the theme Gallery, here are first tests with the
v1.2023.0
and the themecarbon-gray
seems to be broken...Here is minimal example:
See also error here (from Action on theme Gallery):
See all log here:
I search what is broken...
Regards.