quarto-dev / quarto-dev/quarto-r

Add a escape shortcode function

Open
#286 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
161
Forks
29
Avg merge
3h 18m
Merged PRs (30d)
1

Description

I used this once

escape_shortcodes <- function(text) {
  # Pattern that matches {{< >}} but NOT {{{< >}}} (already escaped)
  shortcode_pattern <- "(?<!\\{)(\\{\\{<[^>]*>\\}\\})(?!\\})"
  text <- gsub(shortcode_pattern, "{\\1}", text, perl = TRUE)
  text
}

Is this useful to add ? 🤔

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, entry point, or test is named. Start by locating existing shortcode handling in the quarto-r package and determine whether a public escape_shortcodes function belongs there; then verify the supplied examples, including escaping {{< >}} without changing already escaped {{{< >}}}.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
content
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.