I found out this difference with diff
.
The contents above ---
are outputs of MarkdownParse.java in Joe's repository.
The contents below ---
are outputs of MarkdownParse.java in my repository.
texts in test-files/490.md
and test-files/510.md
I think the expected output is
[]
because a string in which a line break exists should not be a URL.
output when testing test-files/490.md
:
According to the actual output I think Joe's implementation is correct for test 490.md
.
description of the bug in my MarkdownParse.java:
This is the implementation in my MarkdownParse.java where the link is added to the result ArrayList toReturn
This is the implementation in Joe's MarkdownParse.java where the link is added to the result ArrayList toReturn
My implementation doesn't check for the condition Joe's implementation checks. In Joe's MarkdownParse.java, we see that if potentialLink.indexOf("\n")==-1
, which means no line break exists in potentialLink
,then the link is not added to result.
I think the expected output is
[]
because there is a white space between ]
and (
output when testing test-files/510.md
:
According to the actual output I think my implementation is correct for test 510.md
.
description of the bug in Joe's MarkdownParse.java:
This is the implementation in Joe's MarkdownParse.java
This is the implementation in my MarkdownParse.java
Joe's implementation doesn't check for the condition my implementation checks. In my implementation, the substring would be added to result only if nextCloseBracket + 1 == openParen
, which means the ]
and (
are next to each other. Joe's implementation doesn't check for this condition.