Skip to content

Commit

Permalink
Lab 3 Part 5 nidhidhamnani#2
Browse files Browse the repository at this point in the history
Fixed error where the syntax []"text"() would still return a link despite being incorrect.
  • Loading branch information
jeyiu committed Apr 16, 2022
1 parent b3bcd69 commit 09f4c6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MarkdownParse.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ public static ArrayList<String> getLinks(String markdown) {
int max2 = Math.max(openParen, closeParen);
currentIndex = Math.max(max1, max2) +1;
}else{
toReturn.add(markdown.substring(openParen + 1, closeParen));
if(openParen == closeBracket+1){
toReturn.add(markdown.substring(openParen + 1, closeParen));
}
currentIndex = closeParen + 1;

}

}
Expand Down
1 change: 1 addition & 0 deletions test-file-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[link1](https://nyaa.si)
![img](hello.com)
[link2\]](hello).com)
))))))


[link]
Expand Down

0 comments on commit 09f4c6a

Please sign in to comment.