Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b687440 authored by Wu-cheng Li's avatar Wu-cheng Li Committed by Android Git Automerger
Browse files

am fcc7cf77: Fix the check of double quoted @see tag.

Merge commit 'fcc7cf77' into froyo-plus-aosp

* commit 'fcc7cf77':
  Fix the check of double quoted @see tag.
parents db00a567 fcc7cf77
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -58,6 +58,12 @@ public class LinkReference {
            = Pattern.compile("^<a href=\"([^\"]*)\">([^<]*)</a>[ \n\r\t]*$",
                              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.
     *
@@ -321,15 +327,15 @@ public class LinkReference {

        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("<")) {