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

CSS selection rules should include hyphens and underscores #354

Merged
merged 16 commits into from
Jan 3, 2023

Conversation

slodge
Copy link
Contributor

@slodge slodge commented Nov 10, 2022

Fixes #355

Extend the current regexes to allow selections of examples like:

  • <my-hyphened-tag />
  • <my_underscored_tag />
  • <div class="my-hyphened-class" />
  • <div class="my_underscored_class" />
  • <div id="my-hyphened-id" />
  • <div id="my_underscored_id" />
  • <my-hyphened-tag id="my_underscored_id" class="my_underscored_class my-hyphened-class" />

These are valid identifiers based on https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier

Todo:

  • Change the selector.R code and test locally
  • Update tests
  • Update NEWS.md
  • Link to an issue
  • Sign CLA (waiting on Legal at work - should be quick)

Allow selections of examples like:

- `<my-hyphened-tag />`
- `<my_underscored_tag />`
- `<div class="my-hyphened-class" />`
- `<div class="my_underscored_class" />`
- `<div id="my-hyphened-id" />`
- `<div id="my_underscored_id" />`

Todo:

[x] Change the selector.R code
[ ] Update tests
@CLAassistant
Copy link

CLAassistant commented Nov 10, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ slodge
✅ schloerke
❌ Stuart Lodge


Stuart Lodge seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@slodge slodge changed the title [Draft] CSS selection rules should include hyphens and underscores CSS selection rules should include hyphens and underscores Nov 10, 2022
Copy link
Collaborator

@schloerke schloerke left a comment

Choose a reason for hiding this comment

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

👏👏 Some cosmetic changes to make then we'll merge the PR. Thank you!

NEWS.md Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
tests/testthat/test-selector.R Show resolved Hide resolved
R/selector.R Outdated Show resolved Hide resolved
R/selector.R Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
slodge and others added 5 commits November 16, 2022 05:45
Co-authored-by: Barret Schloerke <barret@rstudio.com>
Co-authored-by: Barret Schloerke <barret@rstudio.com>
Co-authored-by: Barret Schloerke <barret@rstudio.com>
@slodge
Copy link
Contributor Author

slodge commented Dec 28, 2022

+ 6323da93a22f171f2810657ea07b29aaaa44de80 `devtools::document()` (GitHub Actions)
Error: Some auto-generated commits were found. GHA is not allowed to push commits back to a forked repo.
Error: Please perform and commit these actions manually. It may help to merge in the latest changes from the base branch.
Error: Process completed with exit code 1.

Saw this error... have pushed some changes - but they're nothing to do with this commit...

Personally I'm very happy with GitHub Actions running document instead of developers - sounds like a perfect place for automation to reduce work rather than adding to it :)

(insert post-xmas back-at-work fat and grumpy Stuart emoji here)

@schloerke
Copy link
Collaborator

GHA routine issue is unrelated to this PR

@schloerke schloerke mentioned this pull request Jan 3, 2023
@schloerke schloerke merged commit f07ceba into rstudio:main Jan 3, 2023
schloerke added a commit that referenced this pull request Feb 14, 2023
* main:
  CSS selection rules should include hyphens and underscores (#354)
  `document()` (#360)
  Start new version
  v0.5.4 release candidate (#357)
  Fix bindFillRole() documentation example
  roxygenize
  Fix outdated news
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.

Support hyphens in tag/element css selectors
4 participants