Skip to content

Do not let gt perform Markdown processing when in a Quarto context #2004

@rich-iannone

Description

@rich-iannone

When gt does Markdown processing, it uses markdown::mark() but I've recently become aware that this now uses litedown::mark(). This has implications for reference processing so this needs to be looked at.

Also, when inside a Quarto render, mark() is still called. This is shown with this example that issues Warning in replace(z): Reference key(s) not found: tbl-kable-equation (which comes from markdown::mark()).

data.frame(
  Feature = c("Formatting", "Math", "References", "Media"),
  Example = c(
    c("**Bold**, *italic*, and `code`"),
    "$\\int_{a}^{b} f(x) \\, dx$",
    "See @tbl-kable-equation for example of a table",
    "{{< video https://www.youtube.com/embed/wo9vZccmqwc >}}"
  ),
  Notes = c(
    "Basic markdown formatting",
    "LaTeX math expressions",
    "Cross-references to other document elements",
    "Embedded media using shortcodes"
  )
) |>
  gt() |>
  fmt_markdown(columns = "Example")

In the Quarto context, we should not do any Markdown processing. I think the exception is if tab_options(quarto.disable_processing = TRUE) is used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions