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 missing class name in "Unknown tag" message #2398

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

quantsch
Copy link
Contributor

Problem

Introduced in #2378, the class of the unknown tags are never shown given that the string of the unknown tags is passed as second argument instead of string interpolation.

Reprex

library(pkgdown)
pkgdown:::as_html.tag("test")
#> Message:
#> Unknown tag:
#> [1] ""

Created on 2024-02-15 with reprex v2.1.0

Solution

Analogue to https://github.com/r-lib/pkgdown/pull/2378/files#diff-7800ebb360a3c28cd33101ef6ea07c562247ec30a029d0a69d527a80f17bff17L158-R164. I also changed the severity to warning.

@quantsch quantsch force-pushed the fix/show-unknown-tag-class branch from 7f5a4b9 to 6355d5b Compare February 15, 2024 21:37
@quantsch quantsch force-pushed the fix/show-unknown-tag-class branch from 6355d5b to 982581e Compare February 15, 2024 21:38
@quantsch quantsch closed this Feb 15, 2024
@quantsch quantsch reopened this Feb 15, 2024
@olivroy
Copy link
Collaborator

olivroy commented Feb 15, 2024

Note that this works pretty well too!

cli::cli_text("{.cls {class(dplyr::band_instruments)}}")
#> <tbl_df/tbl/data.frame>

So, cli::cli_inform("Unknown tag: {.cls {class(x)}}") would work well!

@quantsch
Copy link
Contributor Author

Thanks for the suggestion, absolutely valid. Adjusted accordingly.

Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

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

Could you please leave it as a message instead of a warning? Making that change potentially has unintended consequences that I'd prefer not to reason through right now.

@hadley hadley merged commit 70495ff into r-lib:main Mar 11, 2024
13 checks passed
@hadley
Copy link
Member

hadley commented Mar 11, 2024

Thank you!

SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this pull request Jun 1, 2024
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