Skip to content

Add a escape shortcode function #286

@cderv

Description

@cderv

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 ? 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions