Conversation
Intention is that image should not be counted as URLs of links
Original program treated image source link as url links as well which it shouldn't but not it does not count image source links as urls.
Original fix on not making the file identify image links caused another bug that made the program no identify actual links that are also in that file.
Fixed bug where when at least one of [,],(,) isn't found then not possible to have an link so stops the search. CAUTION HOW EVER THE WAY THAT THE IF STATEMENTS ARE SETUP FALSE LINKS MAY TRIGGER A TRUE FOR ONE OF THE IF STATEMENTS SO NEED TO REFACTOR THE CHECKS.
To Run Test/JUnit test in the terminal javac -cp ".;lib\junit-4.13.2.jar;lib\hamcrest-core-1.3.jar" MarkdownParseTest.java java -cp ".;lib/junit-4.13.2.jar;lib/hamcrest-core-1.3.jar" org.junit.runner.JUnitCore MarkdownParseTest adjust Junit Versions as needed.
Path fileName = Path.of("test-file.md");
this link doesn't work when running JUnit through VSCode. to run it through VSCode's testing you need to give the full path. but this works in terminal running.
Changed the fileNames such that the running Junit test using VSCode testing works and terminal testing also works.
Source of the test files: https://github.com/nidhidhamnani/markdown-parser
Failure-inducing input fixed:
links where the [] area was empty but was treated as a link
Symptom shown: wrong answer symptom
bug that fixed the symptom:
checking that the open and close brackets are not right next to each other.
Originally had link then image but was supposed to be image then link
Reverting changes for the purpose of the task of the lab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/Miyuki-L/markdown-parser/blob/c5001a6b54bcd55263bd944a1d4ce1473598d748/MarkdownParse.java#L29-L30
For these lines, you can probably delete to make the file cleaner or any comments that you don't need