diff --git a/DESCRIPTION b/DESCRIPTION index c16582c..2dfe0be 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,7 +20,7 @@ Suggests: curl, testthat, xml2 -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 Roxygen: list(markdown = TRUE) Language: en-US Encoding: UTF-8 diff --git a/NEWS b/NEWS index 59be9da..42c3e65 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ -1.9.3 +1.9.4 - Apply upstream PR https://github.com/github/cmark-gfm/pull/362 + - Require double-tilde `~~` for the strikethrough extension, for consistency with Pandoc's Markdown 1.9.1 - Update libcmark-gfm to 0.29.0.gfm.13 diff --git a/R/extensions.R b/R/extensions.R index 25fa328..64b4a2a 100644 --- a/R/extensions.R +++ b/R/extensions.R @@ -6,7 +6,7 @@ #' Currently the following extensions are supported: #' #' - **table** support rendering of tables: [gfm-spec section 4.10](https://github.github.com/gfm/#tables-extension-) -#' - **strikethrough** via `~sometext~` syntax: [gfm-spec section 6.5](https://github.github.com/gfm/#strikethrough-extension-) +#' - **strikethrough** via `~~sometext~~` syntax: [gfm-spec section 6.5](https://github.github.com/gfm/#strikethrough-extension-) #' - **autolink** automatically turn URLs into hyperlinks: [gfm-spec section 6.9](https://github.github.com/gfm/#autolinks-extension-) #' - **tagfilter** blacklist html tags: `title` `textarea` `style` `xmp` `iframe` #' `noembed` `noframes` `script` `plaintext`: [gfm-spec section 6.11](https://github.github.com/gfm/#disallowed-raw-html-extension-) diff --git a/man/extensions.Rd b/man/extensions.Rd index 9751016..33937ae 100644 --- a/man/extensions.Rd +++ b/man/extensions.Rd @@ -15,7 +15,7 @@ features which are not (yet) in the official commonmark spec. Currently the following extensions are supported: \itemize{ \item \strong{table} support rendering of tables: \href{https://github.github.com/gfm/#tables-extension-}{gfm-spec section 4.10} -\item \strong{strikethrough} via \verb{~sometext~} syntax: \href{https://github.github.com/gfm/#strikethrough-extension-}{gfm-spec section 6.5} +\item \strong{strikethrough} via \verb{~~sometext~~} syntax: \href{https://github.github.com/gfm/#strikethrough-extension-}{gfm-spec section 6.5} \item \strong{autolink} automatically turn URLs into hyperlinks: \href{https://github.github.com/gfm/#autolinks-extension-}{gfm-spec section 6.9} \item \strong{tagfilter} blacklist html tags: \code{title} \code{textarea} \code{style} \code{xmp} \code{iframe} \code{noembed} \code{noframes} \code{script} \code{plaintext}: \href{https://github.github.com/gfm/#disallowed-raw-html-extension-}{gfm-spec section 6.11} diff --git a/tests/testthat/test-extensions.R b/tests/testthat/test-extensions.R index fa922fe..f4a9488 100644 --- a/tests/testthat/test-extensions.R +++ b/tests/testthat/test-extensions.R @@ -47,3 +47,9 @@ test_that("embedded images do not get filtered", { expect_equal(md, markdown_html(md)) expect_equal(md, markdown_commonmark(md)) }) + +test_that("strikethrough", { + md <- "~Hello~ ~~world~~!" + expect_equal(markdown_html(md), "

~Hello~ ~~world~~!

\n") + expect_equal(markdown_html(md, extensions = "strikethrough"), "

~Hello~ world!

\n") +})