Skip to content

Commit

Permalink
prevent single tildes from becoming strikethrough
Browse files Browse the repository at this point in the history
This will fix #25
  • Loading branch information
zkamvar committed May 9, 2024
1 parent 1209f2d commit 6111d2b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: commonmark
Type: Package
Title: High Performance CommonMark and Github Markdown Rendering in R
Version: 1.9.1
Version: 1.9.2
Authors@R: c(
person("Jeroen", "Ooms", ,"[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4035-0289")),
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.9.2
- Prevent single-tildes from being parsed as strikethrough (#25)

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

Expand Down
4 changes: 4 additions & 0 deletions src/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ SEXP R_render_markdown(SEXP text, SEXP format, SEXP sourcepos, SEXP hardbreaks,

/* Prevent filtering embedded resources: https://github.com/github/cmark-gfm#security */
options += CMARK_OPT_UNSAFE;
/* Only process double tildes as strikethrough, otherwise, leave them asis
* https://github.com/r-lib/commonmark/issues/25
* */
options += CMARK_OPT_STRIKETHROUGH_DOUBLE_TILDE;

/* parse input */
SEXP input = STRING_ELT(text, 0);
Expand Down

0 comments on commit 6111d2b

Please sign in to comment.