diff --git a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java index 481ad58ae..a01dc2c3a 100644 --- a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java +++ b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java @@ -84,7 +84,7 @@ public class CommandCreateAttribute extends SingleLineCommand2 { } 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; diff --git a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java index 3f4d93bc6..9ca195110 100644 --- a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java +++ b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java @@ -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 { 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 { 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 quark = diagram.quarkInContext(true, name); Entity entity = quark.getData();