From a145add5d4d51f9060ba407754d956ae370ec737 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Wed, 16 Oct 2024 05:21:53 +1300 Subject: [PATCH] Use double-tilde for strikethrough in Markdown tests (#4144) * Use double-tilde for strikethrough in Markdown tests The current dev version of commonmark has disabled single tilde for strikethrough: https://github.com/r-lib/commonmark/pull/33 Using double-tilde will make it consistent with Pandoc's Markdown (where single-tilde is for subscripts). * Skip tests if commonmark is outdated * Revert "Skip tests if commonmark is outdated" This reverts commit 97bee20863410a25fe1781f24c0d3a802a2b4a71. --------- Co-authored-by: Carson Sievert --- tests/testthat/test-inline-markdown.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/testthat/test-inline-markdown.R b/tests/testthat/test-inline-markdown.R index 200d7fc8b..70c343d89 100644 --- a/tests/testthat/test-inline-markdown.R +++ b/tests/testthat/test-inline-markdown.R @@ -11,18 +11,18 @@ test_that("HTML has correct attributes", { }) test_that("Github extensions are on by default", { - html <- markdown("a ~paragraph~ with a link: https://example.com") + html <- markdown("a ~~paragraph~~ with a link: https://example.com") expect_equal(html, HTML("

a paragraph with a link: https://example.com

\n")) }) test_that("Github extensions can be disabled", { - html <- markdown("a ~paragraph~", extensions = FALSE) - expect_equal(html, HTML("

a ~paragraph~

\n")) + html <- markdown("a ~~paragraph~~", extensions = FALSE) + expect_equal(html, HTML("

a ~~paragraph~~

\n")) }) test_that("Additional options are respected", { - html <- markdown("a ~paragraph~", extensions = FALSE, sourcepos = TRUE) - expect_equal(html, HTML("

a ~paragraph~

\n")) + html <- markdown("a ~~paragraph~~", extensions = FALSE, sourcepos = TRUE) + expect_equal(html, HTML("

a ~~paragraph~~

\n")) }) test_that("Multiline markdown works properly", {