-
-
Notifications
You must be signed in to change notification settings - Fork 872
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
Automatic figure numbering knitr_1.44 fails #2290
Comments
It seems to be a bookdown issue. Minimal reprex ---
title: "My Title"
subtitle: "Subtitle"
author: "Me"
date: "1/1/2016"
output: bookdown::html_document2
---
```{r cars, fig.cap = "<b>An amazing plot</b>"}
plot(cars)
``` Note that removing Using Markdown to put bold works too: |
Thanks for prompt answer. Right, there are tags used and wanted. The problem appeared after updating all packages. Tried both, downgrading to |
The problem comes from c7a423c in #2269 to fix #2023 We produce
and before
It seems this change has broken the refs resolving of bookdown I believe the
An really about this, We could probably run |
This comment was marked as duplicate.
This comment was marked as duplicate.
Thanks @etiennebacher ! That is what I mentioned in #2290 (comment) above. One could also provide ---
title: "My Title"
subtitle: "Subtitle"
author: "Me"
date: "1/1/2016"
output: bookdown::html_document2
---
```{r cars, fig.cap = "<b>An amazing plot</b>", fig.alt="An amazing plot"}
plot(cars)
``` A In knitr
HTML escape means that |
If I understand correctly,
So I guess quoted suggestion would remove any HTML before creating automated alt text which I think would be desirable. Probably nobody needs tags in alt text, they are designed for screen readers or if images won't load, and both don't need HTML tags. Just noticed that
But this probably isn't W3C conform. If you could implement a fix, that would be great. I'm sure I'm not the only lazy person who doesn't specify a specific alt text, and you could keep tons of .rmds with gzillions of figures running without having to change their code. |
With the PR #2291, special HTML characters will be escaped. If you want to strip HTML tags instead, you can use an knitr::opts_hooks$set(fig.cap = function(options) {
if (is.null(options$fig.alt)) options$fig.alt = options$fig.cap
options$fig.alt = xfun::strip_html(options$fig.alt)
options
}) |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
After updating knitr_1.43 to knitr_1.44 captions are no longer numbered and floating right.
Example:
Should be:
Also see https://stackoverflow.com/q/77148220/6574038
Thanks
J
By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: