gt icon indicating copy to clipboard operation
gt copied to clipboard

fmt_markdown breaks a line and put footnote reference onto new line

Open Dobrokhotov1989 opened this issue 2 years ago • 0 comments

I've faced an issue when trying to use footnote on the cells formatted with fmt_markdown(). With fmt_markdown() linebreak between cell content and footnote reference (i.e. 1) is added. In the example below, fmt_markdown() does nothing useful but shows the problem.

  library(tidyverse)
  library(gt)
  
  mpg %>%
    sample_n(10) %>%
    select(manufacturer, model, displ, cty, hwy, year) %>%
    gt() %>%
    tab_footnote(
      footnote = "This is old car",
      locations = cells_body(columns = model,
                             rows = year < 2000)
    ) %>%
    cols_hide(columns = year) %>%
    fmt_markdown(columns = model)

Rplot01

Dobrokhotov1989 avatar Jul 24 '22 02:07 Dobrokhotov1989