Skip to content

Commit f190e7c

Browse files
committed
small corrections
Signed-off-by: Stefan Niederhauser <[email protected]>
1 parent 2f78246 commit f190e7c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

graphviz-java/src/main/java/guru/nidi/graphviz/attribute/Label.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private static String replaceMd(String s, String from, String to) {
145145

146146
/**
147147
* Create either a simple, HTML or markdown label.
148-
* If the value is not surrounded by < and >, a simple Label is created.
148+
* If the value is not surrounded by &lt; and &gt;, a simple Label is created.
149149
* Otherwise if value contains some HTML tags, a HTML label is created.
150150
* Otherwise a markdown label is created.
151151
*

graphviz-taglet/src/main/java/guru/nidi/graphviz/GraphvizTaglet.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,18 @@
3030
* Support graphviz inside javadoc.
3131
* <p>
3232
* {@graphviz
33-
* graph test {a -- b}
33+
* graph test {
34+
* rankdir=LR
35+
* a -- b
36+
* b -- c [color=red]
3437
* }
38+
* }
39+
* </p>
3540
* end
3641
*/
3742
public class GraphvizTaglet implements Taglet {
43+
private static final Pattern START_PATTERN = Pattern.compile("^\\s*(di)?graph\\s*(.*?)\\s\\{");
44+
3845
public static void register(Map<String, Taglet> taglets) {
3946
final GraphvizTaglet taglet = new GraphvizTaglet();
4047
taglets.put(taglet.getName(), taglet);
@@ -92,8 +99,7 @@ public String toString(Tag tag) {
9299
}
93100

94101
private String imageTitleOf(Tag tag) {
95-
final Pattern startPattern = Pattern.compile("^\\s*(di)?graph\\s*(.*?)\\s\\{");
96-
final Matcher matcher = startPattern.matcher(tag.text());
102+
final Matcher matcher = START_PATTERN.matcher(tag.text());
97103
return matcher.find() ? matcher.group(2) : "";
98104
}
99105

0 commit comments

Comments
 (0)