tests/testthat/test-6.5-strikethrough.R

library(testthat)
library(gluedown)
library(rvest)
library(glue)

test_that("md_strike creates a <del> tag (ex. 491)", {
  # https://github.github.com/gfm/#example-491
  text <- paste(md_strike("Hi"), "Hello", "world")
  text %>%
    md_convert() %>%
    read_html() %>%
    html_node("del") %>%
    html_text() %>%
    expect_equal("Hi")
  text %>%
    md_convert() %>%
    read_html() %>%
    html_node("p") %>%
    html_text() %>%
    expect_equal(gsub("~", "", text))
})

Try the gluedown package in your browser

Any scripts or data that you put into this service are public.

gluedown documentation built on Nov. 2, 2023, 5:48 p.m.