Skip to content

Commit

Permalink
Use double-tilde for strikethrough in Markdown tests (#4144)
Browse files Browse the repository at this point in the history
* Use double-tilde for strikethrough in Markdown tests

The current dev version of commonmark has disabled single tilde   for strikethrough: r-lib/commonmark#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 97bee20.

---------

Co-authored-by: Carson Sievert <[email protected]>
  • Loading branch information
yihui and cpsievert authored Oct 15, 2024
1 parent abf7138 commit a145add
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/testthat/test-inline-markdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -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("<p>a <del>paragraph</del> with a link: <a href=\"https://example.com\">https://example.com</a></p>\n"))
})

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

test_that("Additional options are respected", {
html <- markdown("a ~paragraph~", extensions = FALSE, sourcepos = TRUE)
expect_equal(html, HTML("<p data-sourcepos=\"1:1-1:13\">a ~paragraph~</p>\n"))
html <- markdown("a ~~paragraph~~", extensions = FALSE, sourcepos = TRUE)
expect_equal(html, HTML("<p data-sourcepos=\"1:1-1:15\">a ~~paragraph~~</p>\n"))
})

test_that("Multiline markdown works properly", {
Expand Down

0 comments on commit a145add

Please sign in to comment.