test_that("can highlight html file", { skip_if_not_installed("xml2") # verify_output() seems to be generating the wrong line endings skip_on_os("windows") verify_output(test_path("test-downlit-html.txt"), { out <- downlit_html_path(test_path("autolink.html"), tempfile()) cat(brio::read_lines(out), sep = "\n") }) }) test_that("highlight all pre inside div.downlit", { skip_if_not_installed("xml2") html <- xml2::read_xml("
1 + 2
3 + 4
No hightlight" ) downlit_html_node(html) expect_snapshot_output(show_xml(html)) }) test_that("special package string gets linked", { skip_if_not_installed("xml2") html <- xml2::read_xml("
before {downlit}
after
before {notapkg}
after