Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require markdown >= 1.3 and update usage #745

Merged
merged 6 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Imports:
jsonlite,
knitr (>= 1.31),
lifecycle,
markdown,
markdown (>= 1.3),
parallel,
promises,
rappdirs,
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ importFrom(knitr,opts_hooks)
importFrom(knitr,opts_knit)
importFrom(knitr,spin)
importFrom(lifecycle,deprecated)
importFrom(markdown,markdownExtensions)
importFrom(markdown,markdownToHTML)
importFrom(promises,"%>%")
importFrom(promises,promise)
importFrom(promises,then)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# learnr (development version)

- Bumped **markdown** package version requirement to v1.3 and stopped using deprecated functions and options from its older versions (#745).

# learnr 0.11.1

This is a maintenance release that adjusts an example and several tests for CRAN.
Expand Down
2 changes: 0 additions & 2 deletions R/learnr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#' @importFrom knitr opts_knit
#' @importFrom knitr spin
#' @importFrom lifecycle deprecated
#' @importFrom markdown markdownExtensions
#' @importFrom markdown markdownToHTML
#' @importFrom rprojroot find_root
#' @importFrom rprojroot is_r_package
#' @importFrom shiny invalidateLater
Expand Down
8 changes: 1 addition & 7 deletions R/quiz.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,7 @@ quiz_text <- function(text) {
text <- format(text)
}
# convert markdown
md <- markdown::markdownToHTML(
text = text,
options = c("use_xhtml", "fragment_only", "mathjax"),
extensions = markdown::markdownExtensions(),
fragment.only = TRUE,
encoding = "UTF-8"
)
md <- markdown::mark_html(text = text, options = "-standalone")
if (length(str_match_all(md, "</p>", fixed = TRUE)) == 1) {
# remove leading and trailing paragraph
md <- sub("^<p>", "", md)
Expand Down