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

Add custom attribute support to fmt_url (#1428) #1452

Merged
merged 13 commits into from
Oct 5, 2023

Conversation

elipousson
Copy link
Contributor

Summary

This pull request adds the following HTML attributes for the anchor HTML element to the fmt_url() function:

  • hreflang,
  • ping,
  • referrerpolicy,
  • rel,
  • target,
  • type

The primary goal for this addition is to allow the use of values for target other than "_self" but it seemed appropriate to add support for the other attributes at the same time.

Additional documentation could be added explaining the validation for each of the attributes (hreflang and type are not validated and ping is only validated to ensure it is a character vector) and add examples for use of the new parameters. One additional (currently not implemented) feature could be to add a style parameter that allows users to ignore the show_underline and as_button attributes and pass custom CSS for URL formatting.

Related GitHub Issues and PRs

Checklist

Unsure if this constitutes a major change so I have not yet updated NEWS.md.

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

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

LGTM!

@rich-iannone rich-iannone merged commit 4dab304 into rstudio:master Oct 5, 2023
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.

3 participants