Fix to remove trailing parenthesis from parsed Link
#79
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.
Hello react-logviewer!
While trying to parse a
Link
wrapped in parentheses, I found that the trailing parenthesis ramains in the result.For example, when I tried to parse
"(https://example.com)"
, it resulted in["(", "https://example.com)"]
, which does not seem to be a valid URL.Therefore, this pull request patches
parseLinks()
to consider trailing parenthesis, as well as starting parenthesis.Refs
--- Generated by copilot below ---
This pull request includes changes to the link parsing functionality in the
src/components/Utils/utils.ts
file and corresponding tests in thesrc/components/Utils/utils.test.ts
file. The changes improve the handling of links wrapped in parentheses and ensure more accurate parsing of such links.Improvements to link parsing:
src/components/Utils/utils.ts
: Updated theparseLinks
function to handle links wrapped in parentheses by splitting tokens using a more precise regular expression and processing each part accordingly.Testing enhancements:
src/components/Utils/utils.test.ts
: Added new test cases to verify the correct parsing of links wrapped in parentheses, links starting with a parenthesis, and links with a trailing parenthesis.