Hyphen in node id causes syntax error

0 votes
asked Aug 10, 2021 in Question / help by escovedo (140 points)

When i tried to draw some network diagram with nwdiag, it results in Syntax error if i have hyphens in network or node id, such like :

 ```

@startuml

nwdiag {

  network network1 {

    address = "192.0.2.0/16"

    node-1 [address="192.0.2.4"];

    node2 [address="192.0.2.2"];

    node3 [address="192.0.2.3"];

  }

}

@enduml

```

When the hyphens are removed or replaced with underscore, it works.

The problem for me is that the network i am not trying has hyphen/dashes in its network or node names.

Anyone can help me to draw it without changing real-life network/node names ?

  

commented Aug 10, 2021 by Serge Wenger Work (15,620 points)

Hello, you can use description:

[Click on image to see the code]

commented Aug 10, 2021 by escovedo (140 points)

Thanks Serge.

Now it works!

Please bear with me for another question but very similar.

What about network id?

I tried to do same thing either for network id.

It doesnt cause error but nothing changed. Is there any good way to include hyphen in network name?

@startuml
nwdiag {

  network network1 {

    address = "192.0.2.0/16"

    description = "network-1"

    node1 [address="192.0.2.4", description = "node-1"];

    node2 [address="192.0.2.2"];

    node3 [address="192.0.2.3"];

  }

}
@enduml

commented Aug 11, 2021 by escovedo (140 points)
Thanks again for your response , Serge.

Do i need to change the category of this pose to 'Bug'? or had better to wait for acknowledgement of plantuml team?

(I am not really familiar yet with this community how i should handle issues)

1 Answer

0 votes
answered Aug 23, 2021 by plantuml (295,000 points)
Many thanks for the report.
This is fixed in last beta http://beta.plantuml.net/plantuml.jar and on the online server.

Tell us if it's not working for you!

Regards,
commented Aug 24, 2021 by escovedo (140 points)
Hello plantuml team
Now it works fine!
The issue solved.
Thanks a lot!
...