Skip to content

Commit

Permalink
MarkdownParse Bug nidhidhamnani#3 Fix
Browse files Browse the repository at this point in the history
Program incorrectly identified image links as normal links.
  • Loading branch information
matveyvilkin committed Apr 23, 2022
1 parent b234528 commit a52e406
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MarkdownParse.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public static ArrayList<String> getLinks(String markdown) {
int closeBracket = markdown.indexOf("]", openBracket);
int openParen = markdown.indexOf("(", closeBracket);
int closeParen = markdown.indexOf(")", openParen);
toReturn.add(markdown.substring(openParen+1, closeParen));
if (!(markdown.indexOf("!",openBracket-2)==openBracket-1)) {
toReturn.add(markdown.substring(openParen+1, closeParen));
}
currentIndex = closeParen + 1;
}

Expand Down

0 comments on commit a52e406

Please sign in to comment.