diff --git a/DESCRIPTION b/DESCRIPTION index 8e7229a..12107a7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,15 +1,15 @@ Package: tinkr -Title: Casts (R)Markdown Files to XML and Back Again -Version: 0.0.0.9000 +Title: Cast (R)Markdown Files to XML and Back Again +Version: 0.0.0.9001 Authors@R: c(person(given = "Maƫlle", family = "Salmon", - role = c("aut", "cre"), + role = c("aut"), email = "msmaellesalmon@gmail.com", comment = c(ORCID = "0000-0002-2815-0399")), person(given = "Zhian N.", family = "Kamvar", - role = "aut", + role = c("aut", "cre"), email = "zkamvar@gmail.com", comment = c(ORCID = "0000-0003-1458-7108")), person(given = "Jeroen", diff --git a/NEWS.md b/NEWS.md index 3b109ff..432ab69 100644 --- a/NEWS.md +++ b/NEWS.md @@ -24,6 +24,7 @@ (@zkamvar #56) * 2021-10-18: links and asis nodes that are at the beginning of paragraphs are no longer escaped (@zkamvar, #58) +* 2022-02-07: @zkamvar is now the maintainer # tinkr 0.0.0.9000 diff --git a/tests/testthat/test-asis-nodes.R b/tests/testthat/test-asis-nodes.R index cf310b0..d6cca1b 100644 --- a/tests/testthat/test-asis-nodes.R +++ b/tests/testthat/test-asis-nodes.R @@ -19,6 +19,22 @@ test_that("multi-line inline math can have punctutation after", { } }) + +test_that("math with LaTeX protection will still work", { + + expected <- c("Example 1: $a = \\begin{pmatrix} b \\\\ c \\end{pmatrix}$", + "Example 2: $f(x, \\, y)$", + "Example 3: $f(x, \\; y)$") + expected <- paste(expected, collapse = "\n\n") + math <- commonmark::markdown_xml(expected) + txt <- xml2::read_xml(math) + protxt <- protect_inline_math(txt, md_ns()) + actual <- to_md(list(yaml = NULL, body = protxt)) + expect_equal(actual, expected) + +}) + + test_that("math with inline code still works", { expected <- "some inline math, for example $R^2 = `r runif(1)`$, is failing with code\n"