tests/testthat/test-6.8-autolinks.R

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

test_that("md_autolink creates a <a> tag (ex. 602)", {
  # https://github.github.com/gfm/#example-602
  url <- "http://foo.bar.baz"
  md_autolink(url) %>%
    md_convert() %>%
    read_html() %>%
    html_node("a") %>%
    html_attr("href") %>%
    expect_equal(url)
})

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.