LinkReferenceDefinitionParser { private boolean title(Scanner scanner) { Position start = scanner.position(); if (!LinkScanner.scanLinkTitleContent(scanner, titleDelimiter)) { return false; } title.append(scanner.textBetween(start, scanner.position())); if (!scanner.hasNext()) { title.append('\n'); return true; } scanner.next(); scanner.whitespace(); if (scanner.hasNext()) { return false; } referenceValid = true; finishReference(); paragraphLines.clear(); state = State.START_DEFINITION; return true; }  void parse(CharSequence line); void addSourceSpan(SourceSpan sourceSpan);  }
@Test public void testTitle() { LinkReferenceDefinitionParser parser = new LinkReferenceDefinitionParser(); parser.parse("[foo]: /url 'title'"); assertEquals(State.START_DEFINITION, parser.getState()); assertParagraphLines("", parser); assertEquals(1, parser.getDefinitions().size()); assertDef(parser.getDefinitions().get(0), "foo", "/url", "title"); }