Skip to content

Commit

Permalink
Hotfix of reference link notation
Browse files Browse the repository at this point in the history
  • Loading branch information
takahi-i committed Dec 13, 2017
1 parent 8920532 commit 8ee5653
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ public void visit(RefLinkNode refLinkNode) {
String url = getRefLinkUrl(refLinkNode.referenceKey, linkName);
// FIXME how to handle url, if linkName include period character?
// TODO temporary implementation
if (candidateSentences.size() == 0) { return; }
CandidateSentence lastCandidateSentence =
candidateSentences.get(candidateSentences.size() - 1);
if (StringUtils.isNotEmpty(url)) {
Expand Down
14 changes: 14 additions & 0 deletions redpen-core/src/test/java/cc/redpen/MarkdownParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,20 @@ void testThreeSuccuessiveImageNestedLinkWithJaConf() throws Exception {
}
}

@Test
void testReferenceLink() throws Exception {
String sampleText =
"[![foo](foo)][bar]\n\n" +
"[bar]: bar\n";
Configuration conf = Configuration.builder("ja").build();
try {
createFileContent(sampleText, conf);
} catch (Exception e) {
fail("Exception is not expected.");
}
}


@Test
void testNotExtractNoLabelImage() throws Exception {
String sampleText = "![](https://aimless.jp/blog/images/2016-09-07-001.png)\n";
Expand Down

0 comments on commit 8ee5653

Please sign in to comment.