-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
xaringan breaks on unmatched "]" within code chunk #320
Comments
I think this is a
It seems a bit trickier here as this happens in code part and the HTML code does not seem to work. Unless ---
title: "Xaringan wtf ']'?"
output:
xaringan::moon_reader:
lib_dir: libs
---
```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
```
.pull-left[
works nicely
```{r}
cat("test")
```
]
.pull-right[
breaks
```{r, results="asis"}
cat('test]')
```
] @yihui did you encounter this ? Do we have tools to handle the HTML escaping of such thing ? This seems like a limitation of remarkjs not so simple to overcome. (but could be with hooks or else maybe?) |
@cderv I haven't encountered this myself, although I was aware of this issue. I also feel it won't be simple to overcome. I guess we can escape unbalanced |
Yes I was thinking the same. It won't be simple. It will require some thinking. @k-hench can I asked the use case ? The real life example you have ? Is it in a cat output inside a code chunk as in the small example ? |
So, the real life example was connected to a ggplot-tutorial, in which I wanted to pre-set values for a binned color scale. A small code example of what I was trying to show (and my current hacky solution, which is to include
|
Has there been any progress on this issue? I am experiencing it on panel slides. It always adds a random ] after the heading and before the panels. I found the line by inspecting the output source element, but I can't find a way to make it go away. I can delete it from my immediate view, but I can't save the change. It reappears when I open the document. |
@DancinByMoonlight Can you share the original Rmd or link to the source (or a smaller example that reproduces the problem)? |
I'm a new member to github because I was hoping for help with this problem. I tried to upload an rmd file, but it says that type isn't accepted. It doesn't allow the html file, either. But I did copy/paste some example code in here. I hope it's in an okay format.
|
I stumbled upon a weird issue that is breaking my xaringan presentation: Apparently the including an unmatched
"]"
within a string in a code chunk is being interpreted as closing a css-class specifier and thus closes the code chunk prematurely.Here is a minimal example of the problem - in my case the code chunk in the right column of slide 2 does not render correctly and interferes with the column definition itself.
I render the following file (
xaringan_bugtrace.Rmd
), using either the "knit"-button within RStudio, or by runningrmarkdown::render("xaringan_bugtrace.Rmd")
:which results in the following broken slide:
A similar thing happens when the unmatched
]
appears in a results code block (eg. when replacing thecat("test]")
withcut(1:5,breaks = c(0,2,5))
):Stackoverflow ref:
https://stackoverflow.com/questions/67651622/how-to-include-an-unmatched-within-a-rmarkdown-xaringan-code-chunk
Session info:
By filing an issue to this repo, I promise that
xfun::session_info('xaringan')
. 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/xaringan')
.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: