Fix stereotype handling

This commit is contained in:
Benjamin Davies 2023-11-16 10:03:30 +13:00
parent 4d01e6fd6c
commit 153b96af3e
No known key found for this signature in database
GPG Key ID: 9FFDE0674336C460
2 changed files with 8 additions and 3 deletions

View File

@ -84,7 +84,7 @@ public class CommandCreateAttribute extends SingleLineCommand2<ChenEerDiagram> {
}
final LeafType type = LeafType.USECASE;
final String name = diagram.cleanId(arg.get("NAME", 0));
final String name = diagram.cleanId(arg.get("NAME", 0).trim());
final String id = owner.getName() + "/" + name;
final boolean composite = arg.get("COMPOSITE", 0) != null;

View File

@ -46,6 +46,7 @@ import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf;
import net.sourceforge.plantuml.regex.RegexOptional;
import net.sourceforge.plantuml.regex.RegexResult;
import net.sourceforge.plantuml.utils.LineLocation;
@ -59,7 +60,11 @@ public class CommandCreateEntity extends SingleLineCommand2<ChenEerDiagram> {
return RegexConcat.build(CommandCreateEntity.class.getName(), RegexLeaf.start(), //
new RegexLeaf("TYPE", "(entity|relationship)"), //
RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("NAME", "(\\w+)"), //
new RegexLeaf("NAME", "([^<>{}]+)"), //
new RegexOptional(//
new RegexConcat(
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREOTYPE", "(<<.+>>)"))), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("\\{"), //
RegexLeaf.end());
@ -69,7 +74,7 @@ public class CommandCreateEntity extends SingleLineCommand2<ChenEerDiagram> {
protected CommandExecutionResult executeArg(ChenEerDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final LeafType type = LeafType.OBJECT;
final String name = diagram.cleanId(arg.get("NAME", 0));
final String name = diagram.cleanId(arg.get("NAME", 0).trim());
final Quark<Entity> quark = diagram.quarkInContext(true, name);
Entity entity = quark.getData();