Skip to content

Commit

Permalink
Use double-tilde for strikethrough in Markdown tests
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
yihui authored Oct 13, 2024
1 parent abf7138 commit 6dbaf26
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 6dbaf26

Please sign in to comment.