Skip to content
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

feat(write_bib): escape & as much as possible (closes #2335) #2342

Merged
merged 3 commits into from
May 1, 2024

Conversation

atusy
Copy link
Collaborator

@atusy atusy commented May 1, 2024

In write_bib, apply gsub('(?<!\\\\)&', '\\\\&', x, perl = TRUE) to escape unespcaped ampersands.

Note that released implementation partially applies the escape.
Instead, I apply the escape as later as possible so that the escape happens widely.

Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you!

Instead, I apply the escape as later as possible so that the escape happens widely.

I think that's a very good idea.

NEWS.md Outdated Show resolved Hide resolved
@yihui yihui linked an issue May 1, 2024 that may be closed by this pull request
@yihui yihui merged commit 726fe15 into yihui:master May 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: tweak non-escaped ampersand
2 participants