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

Fix Poppler C++ regex for pdftools #189

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Fix Poppler C++ regex for pdftools #189

merged 1 commit into from
Sep 27, 2024

Conversation

glin
Copy link
Contributor

@glin glin commented Sep 26, 2024

\b word boundaries don't apply if the end of the word is a character like +. \B matches non-word boundaries, but we don't really need any boundary here.

> 'Poppler C++ API'.match(/\bPoppler C\+\+\b/i)
null

> 'Poppler C++ API'.match(/\bPoppler C\+\+\B/i)
[
  'Poppler C++',
  index: 0,
  input: 'Poppler C++ API',
  groups: undefined
]

> 'Poppler C++ API'.match(/\bPoppler C\+\+/i)
[
  'Poppler C++',
  index: 0,
  input: 'Poppler C++ API',
  groups: undefined
]

@glin
Copy link
Contributor Author

glin commented Sep 26, 2024

cc @jeroen for review

@jeroen
Copy link
Contributor

jeroen commented Sep 27, 2024

Thanks for debugging this, LGTM!

I personally think this regex overcomplicates it really, why not just use /poppler/i. The only edge cases I can think of is that this may install this c++ library also for R packages that uses other poppler tools, which is harmless.

@glin
Copy link
Contributor Author

glin commented Sep 27, 2024

Yeah, that was exactly why since we recently added a rule for poppler-glib that only applied to Rpoppler. While poppler-cpp only applied to pdftools. There was no other package that only specified "poppler". #179

@glin glin merged commit fd0266d into main Sep 27, 2024
46 checks passed
@glin glin deleted the fix-poppler branch September 27, 2024 19:46
@jeroen
Copy link
Contributor

jeroen commented Sep 27, 2024

OK great, I confirm this fixed the CI of pdftools!

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.

2 participants