Skip to content

Commit a84bfe4

Browse files
committed
Update katexjs
1 parent f5ed670 commit a84bfe4

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

‎DESCRIPTION‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: katex
22
Type: Package
33
Title: Rendering Math to HTML, 'MathML', or R-Documentation Format
4-
Version: 1.4.1
4+
Version: 1.5.0
55
Authors@R: c(person("Jeroen", "Ooms", role = c("aut", "cre"), email = "[email protected]",
66
comment = c(ORCID = "0000-0002-4035-0289")),
77
person("Khan Academy and other contributors", role = "cph", comment="KaTeX JavaScript library"))
@@ -17,7 +17,7 @@ URL: https://docs.ropensci.org/katex/,
1717
https://katex.org/docs/options.html (upstream)
1818
BugReports: https://github.com/ropensci/katex/issues
1919
Encoding: UTF-8
20-
RoxygenNote: 7.2.1
20+
RoxygenNote: 7.3.2.9000
2121
Imports: V8
2222
Roxygen: list(markdown = TRUE)
2323
VignetteBuilder: knitr

‎NEWS‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.5.0
2+
- Update to katex.js 0.16.9
3+
14
1.4.1
25
- Update to katex.js 0.16.3
36
- Workaround htmltidy bug not allowing 'em' sizes in Rd files

‎R/katex.R‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#' markdown documents.
55
#' The conversion is done in R using V8 ("server-side"), hence the resulting fragment can
66
#' be inserted into an HTML document without the need for a JavaScript library like MathJax.
7-
#' Only the [katex.css](https://cdn.jsdelivr.net/npm/[email protected].3/dist/katex.min.css)
7+
#' Only the [katex.css](https://cdn.jsdelivr.net/npm/[email protected].9/dist/katex.min.css)
88
#' style file is required in the final html document.
99
#' Use [math_to_rd] for embedding math into R documentation (`.rd`) pages.
1010
#'
@@ -48,7 +48,7 @@ katex_html <- function(tex, displayMode = TRUE, ..., include_css = FALSE, previe
4848
viewer(tmp)
4949
}
5050
if(isTRUE(include_css))
51-
html <- paste('<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected].3/dist/katex.min.css" data-external="1">', html, sep = '\n')
51+
html <- paste('<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected].9/dist/katex.min.css" data-external="1">', html, sep = '\n')
5252
structure(html, class = c('html', 'character'))
5353
}
5454

@@ -67,11 +67,11 @@ example_math <- function(){
6767
#' @importFrom V8 v8
6868
.onLoad <- function(lib, pkg){
6969
assign("ctx", V8::v8("window"), environment(.onLoad))
70-
ctx$source(system.file("js/katex-0.16.3.min.js", package = pkg))
71-
ctx$source(system.file("js/cheerio-0.22.min.js", package = pkg))
72-
ctx$source(system.file("js/bindings.js", package = pkg))
70+
ctx$source(system.file("js/katex-0.16.9.min.js", package = pkg, mustWork = TRUE))
71+
ctx$source(system.file("js/cheerio-0.22.min.js", package = pkg, mustWork = TRUE))
72+
ctx$source(system.file("js/bindings.js", package = pkg, mustWork = TRUE))
7373
if(identical(.Platform$OS.type, 'windows') && getRversion() < '4.1.2'){
74-
ctx$source(system.file("js/he.min.js", package = pkg))
74+
ctx$source(system.file("js/he.min.js", package = pkg, mustWork = TRUE))
7575
ctx$eval('function escape_utf8(rd){return he.encode(rd, {allowUnsafeSymbols: true})}')
7676
}
7777
}
@@ -92,7 +92,7 @@ template <- '<!DOCTYPE html>
9292
<html>
9393
<head>
9494
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
95-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].3/dist/katex.min.css" data-external="1">
95+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].9/dist/katex.min.css" data-external="1">
9696
</head>
9797
<body>
9898
{{math}}

‎inst/js/bindings.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ function html_render_math(html, include_css, options){
2626
if(include_css){
2727
var head = $('head');
2828
if(head.length){
29-
head.append('<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected].3/dist/katex.min.css" data-external="1">');
29+
head.append('<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected].9/dist/katex.min.css" data-external="1">');
3030
} else {
3131
/* html snippet without a proper <head>, just append css at the top */
32-
$.root().prepend('<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected].3/dist/katex.min.css" data-external="1">\n');
32+
$.root().prepend('<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected].9/dist/katex.min.css" data-external="1">\n');
3333
}
3434
}
3535
return $.html();

‎inst/js/katex-0.16.3.min.js‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎inst/js/katex-0.16.9.min.js‎

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

‎man/katex.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.

0 commit comments

Comments
 (0)