Link to my markdown-parse repository: Link Here
Link to the reviewed repository from week 7 lab: Link Here
From the preview above, we can see that the Expected Output is:
[`google.com, google.com, ucsd.edu]
The Test Case for Snippet 1:
From the preview above, we can see that the Expected Output is:
[a.com, a.com(()), example.com]
The Test Case for Snippet 2:
From the preview above, we can see that the Expected Output is:
[https://sites.google.com/eng.ucsd.edu/cse-15l-spring-2022/schedule]
The Test Case for Snippet 3:
Answer: I think a small code change will make the program work for snippet 1. When checking the bracket and parenthesis indices, it should also check if there are brackets surrounding (covering) the back-ticks. If so, the link is still value; if not, ignore the invalid link.
Answer: I think a small code change will make the program work for snippet 2. When checking the brackets indices, it should also check if there is valid paired brackets (open bracket and close bracket) inside another paired brackets. If so, consider only the outer brackets and the link is still value; if not, ignore the invalid link.
Answer: I think a small code change will make the program work for snippet 3. The code should check if the link contains spaces and/or line breaks away from the parentheses and brackets. If so, the link is invalid and will be ignored.