Skip to content

Commit 05f81d7

Browse files
committed
add tests and update doc
1 parent 9037c21 commit 05f81d7

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Suggests:
2020
curl,
2121
testthat,
2222
xml2
23-
RoxygenNote: 7.2.3
23+
RoxygenNote: 7.3.2
2424
Roxygen: list(markdown = TRUE)
2525
Language: en-US
2626
Encoding: UTF-8

NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
1.9.3
1+
1.9.4
22
- Apply upstream PR https://github.com/github/cmark-gfm/pull/362
3+
- Require double-tilde `~~` for the strikethrough extension, for consistency with Pandoc's Markdown
34

45
1.9.1
56
- Update libcmark-gfm to 0.29.0.gfm.13

R/extensions.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#' Currently the following extensions are supported:
77
#'
88
#' - **table** support rendering of tables: [gfm-spec section 4.10](https://github.github.com/gfm/#tables-extension-)
9-
#' - **strikethrough** via `~sometext~` syntax: [gfm-spec section 6.5](https://github.github.com/gfm/#strikethrough-extension-)
9+
#' - **strikethrough** via `~~sometext~~` syntax: [gfm-spec section 6.5](https://github.github.com/gfm/#strikethrough-extension-)
1010
#' - **autolink** automatically turn URLs into hyperlinks: [gfm-spec section 6.9](https://github.github.com/gfm/#autolinks-extension-)
1111
#' - **tagfilter** blacklist html tags: `title` `textarea` `style` `xmp` `iframe`
1212
#' `noembed` `noframes` `script` `plaintext`: [gfm-spec section 6.11](https://github.github.com/gfm/#disallowed-raw-html-extension-)

man/extensions.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-extensions.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,9 @@ test_that("embedded images do not get filtered", {
4747
expect_equal(md, markdown_html(md))
4848
expect_equal(md, markdown_commonmark(md))
4949
})
50+
51+
test_that("strikethrough", {
52+
md <- "~Hello~ ~~world~~!"
53+
expect_equal(markdown_html(md), "<p>~Hello~ ~~world~~!</p>\n")
54+
expect_equal(markdown_html(md, extensions = "strikethrough"), "<p>~Hello~ <del>world</del>!</p>\n")
55+
})

0 commit comments

Comments
 (0)