Skip to content

Commit

Permalink
fix(plantuml) replace - with _
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Selman <[email protected]>
  • Loading branch information
dselman committed Sep 27, 2023
1 parent d82cccd commit be79293
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/codegen/fromcto/plantuml/plantumlvisitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ class PlantUMLVisitor extends DiagramVisitor {
/**
* Escape fully qualified names. We preserve the dots in the
* package name, remove the '@' symbol because it is invalid
* and remove the dots in the version (because otherwise packages get created)
* and remove the dots in the version (because otherwise packages get created).
* We also replace all '-' characters with '_' because they are invalid in
* PlantUML identifiers as '-' can appear in a semver string.
* @param {String} input - the object being visited
* @return {String} string - the parameter
* @protected
Expand All @@ -146,7 +148,7 @@ class PlantUMLVisitor extends DiagramVisitor {
const ns = ModelUtil.getNamespace(input);
const {name,version} = ModelUtil.parseNamespace(ns);
if(version) {
return `${name}_${version.replace(/\./g, '_')}.${typeName}`;
return `${name}_${version.replace(/\./g, '_').replace(/-/g, '_')}.${typeName}`;
}
else {
return `${name}.${typeName}`;
Expand Down

0 comments on commit be79293

Please sign in to comment.