gt
gt copied to clipboard
fmt_markdown breaks a line and put footnote reference onto new line
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)