am 8b687440: am fcc7cf77: Fix the check of double quoted @see tag.
Merge commit '8b687440688ac41d6b6754537bf4a0f9dcb14fbd' into kraken
* commit '8b687440688ac41d6b6754537bf4a0f9dcb14fbd':
Fix the check of double quoted @see tag.
diff --git a/tools/droiddoc/src/LinkReference.java b/tools/droiddoc/src/LinkReference.java
index bbcd4db..b1f998a 100644
--- a/tools/droiddoc/src/LinkReference.java
+++ b/tools/droiddoc/src/LinkReference.java
@@ -59,6 +59,12 @@
Pattern.CASE_INSENSITIVE);
/**
+ * regex pattern to use when matching double-quoted reference text
+ */
+ private static final Pattern QUOTE_PATTERN
+ = Pattern.compile("^\"([^\"]*)\"[ \n\r\t]*$");
+
+ /**
* Parse and resolve a link string.
*
* @param text the original text
@@ -321,15 +327,15 @@
if (text.startsWith("\"")) {
// literal quoted reference (e.g., a book title)
- result.label = text.substring(1);
- skipHref = true;
- if (!result.label.endsWith("\"")) {
+ Matcher matcher = QUOTE_PATTERN.matcher(text);
+ if (! matcher.matches()) {
Errors.error(Errors.UNRESOLVED_LINK, pos,
"unbalanced quoted link/see tag: " + text.trim());
result.makeError();
return result;
}
- result.label = result.label.substring(0, result.label.length() - 1);
+ skipHref = true;
+ result.label = matcher.group(1);
result.kind = "@seeJustLabel";
}
else if (text.startsWith("<")) {