Skip to content

Commit

Permalink
Merge pull request #818 from takahi-i/hotfix-reference-link
Browse files Browse the repository at this point in the history
Hotfix reference link
  • Loading branch information
takahi-i authored Dec 14, 2017
2 parents e25d95b + 8b11d80 commit e6dedf2
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 e6dedf2

Please sign in to comment.