comment placement causes a diagram to fail; is this a bug?

0 votes
asked Jul 29, 2025 in Bug by Frank
I noticed this when trying to put together a demo diagram for a different question on the forum, and thought maybe the PlantUML people would like to be aware of it.

I can define a package like this:

@startuml

' this is a comment
package "Package" <<FooBar Component>>  
{
  class HarpoFred
  class FredFileProcessor
  class FredResponseHandler
}

@enduml

But if I put the comment at the end of the package line, I get an error:

@startuml

package "Package" <<FooBar Component>>  ' this is a comment
{
  class HarpoFred
  class FredFileProcessor
  class FredResponseHandler
}

@enduml

The Common Commands chapter in the manual says "Everything that starts with simple quote ' is a comment", and my understanding is that comments are like whitespace (I am coming from C). So I expected from "' this" to the end of the line to be like a space, and have no effect, but that is not what happens. Or is there some syntax that I am misunderstanding?

1 Answer

0 votes
answered Aug 1, 2025 by The-Lu (86,940 points)

Hello F.,

That is currently the normal behaviour.

See also remark on the doc here:

And ref. here :

Regards,
Th.

...