Skip to content

Unescaped underscores in code rendering as italics in xaringan #32

Open
@machow

Description

@machow

I think this may be more likely to pop up in python, since you can use _ as a variable name 😬. I'm using knitr v1.30.

Rmarkdown code:

---
title: "code examples"
output:
  xaringan::moon_reader:
    lib_dir: libs
    nature:
      ratio: '16:9'
      countIncrementalSlides: false

---


```{python test}
a = 1
_ = 2
_ = 3
```

```{r}
library(flair)
decorate("test") %>% flair("a")
```

Output (note italics in very bottom 2 lines):

image

Looking at the source, it seems that html tags are escaped (for remarkjs?), but underscores are left as is.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is neededknit formats issueflair being weird with certain doc types

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions