md_disallow: Disallow certain raw HTML

View source: R/md-convert.R

md_disallowR Documentation

Disallow certain raw HTML

Description

Take a character vector of raw HTML text (possibly via md_convert()) and disallow certain tags by replacing < with ⁠&lt;⁠.

Usage

md_disallow(html)

Arguments

html

A character vector of markdown text to be converted.

Details

GFM enables the tagfilter extension, where the following HTML tags will be filtered when rendering HTML output:

  • ⁠<title>⁠

  • ⁠<textarea>⁠

  • ⁠<style>⁠

  • ⁠<xmp>⁠

  • ⁠<iframe>⁠

  • ⁠<noembed>⁠

  • ⁠<noframes>⁠

  • ⁠<script>⁠

  • ⁠<plaintext>⁠

Filtering is done by replacing the leading < with the entity ⁠&lt;⁠. These tags are chosen in particular as they change how HTML is interpreted in a way unique to them (i.e. nested HTML is interpreted differently), and this is usually undesireable (sic) in the context of other rendered Markdown content.

All other HTML tags are left untouched.

Value

A glue vector of length 1 containing HTML tags.

See Also

Other inline functions: md_autolink(), md_bold(), md_code(), md_convert(), md_escape(), md_hardline(), md_image(), md_issue(), md_italic(), md_link(), md_softline(), md_strike(), md_text()

Examples

md_disallow("<title>GitHub Flavored Markdown Spec</title>")

gluedown documentation built on May 29, 2024, 11:42 a.m.