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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix how kable_mark() measures column width when there are hyperlinks #2148
Fix how kable_mark() measures column width when there are hyperlinks #2148
Changes from 1 commit
50df605
5dc7def
3189f56
d8bd33e
7cf1af1
44c8362
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also use zero-width positive/negative lookbehind/lookahead assertions (see
?regex
if you are not familiar with them) to avoid treating`[text](url)`
as a URL?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below are two examples of using positive lookbehind/lookahead for matching and replacing. Perhaps I'm missing something, but it seems like the fact that it excludes the brackets and parentheses from the match actually makes it harder to remove them. Both examples have the same regex, which is to look for
[x](
wherex
is 0 or more non-]
characters.But I'm new to zero-width lookbehind/lookahead, so perhaps I'm missing something. Thanks so much for writing
knitr
, by the way -- it's such a valuable tool!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I guess I was not clear last time. I meant we should exclude the case of
[]()
surrounded by backticks (i.e.,(?<!`)
and(?!`)
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see! Thanks for explaining that. I have updated the PR accordingly.