Update column_spec to not put special characters inside of regular expression#900
Closed
RockfordMankiniUCSD wants to merge 1 commit into
Closed
Update column_spec to not put special characters inside of regular expression#900RockfordMankiniUCSD wants to merge 1 commit into
RockfordMankiniUCSD wants to merge 1 commit into
Conversation
Collaborator
|
I think your mods look as though they would work, but what worries me is I don't understand why this is necessary here and not elsewhere. The contents of If dots need escaping, shouldn't that function be modified to do it? |
Collaborator
|
PR #911 (just merged) addresses this issue differently. |
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.
Used to fix the error that comes from running the following code in RMarkdown:
Error:
Analysis:
See this snippet from
column_spec_latexincolumn_spec.R:target_rowis used as a regular expression to match against data from the output ofkbl(). Ifsub()is used with an unescaped., it'll treat it as a wildcard and erroneously substitute out the 4th row, leading to the snippet generating broken LaTeX.Here's the value of the piped
kbl()output from above. You can see a period was erroneously inserted atID & This is a test.\along with other missing LaTeX syntax.Solution: escape the regex before putting it into
sub().