wilkelab / ggtext

Improved text rendering support for ggplot2
https://wilkelab.org/ggtext/
GNU General Public License v2.0
655 stars 37 forks source link

Accented character generates extra-space in `element_markdown` #90

Closed JeanDupin closed 2 years ago

JeanDupin commented 2 years ago

I noticed that using accented characters (such as é, è, ...) generates extra-space in labels when there is spacing. Here's an example:

ggplot(iris,
       aes(x = Species,
           y = Sepal.Length)) +
  geom_point() +
  scale_x_discrete(labels = c(
    "**A<br>é e**",
    "A<br>e e",
    "A<br>è e"
  )) +
  theme(axis.text.x = ggtext::element_markdown())

![plot](https://user-images.githubusercontent.com/98600370/177568052-1e810c61-9757-4e7c-b6d7-e52f8acf8253.png)
clauswilke commented 2 years ago

Same issue as #19?

JeanDupin commented 2 years ago

You're right! Sorry for bothering