Skip to content

Commit

Permalink
p<0.001 fixup to allow <sup>
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Oct 6, 2023
1 parent 509cb73 commit 1279fd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Description: Create beautiful and customizable tables to summarize several
RTF, JPG, or PNG. Tables can easily be embedded in 'Rmarkdown' or 'knitr'
dynamic documents. Details can be found in Arel-Bundock (2022)
<doi:10.18637/jss.v103.i01>.
Version: 1.4.2.9007
Version: 1.4.2.9008
Authors@R: c(person("Vincent", "Arel-Bundock",
email = "[email protected]",
role = c("aut", "cre"),
Expand Down
6 changes: 4 additions & 2 deletions R/factory_kableExtra.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ factory_kableExtra <- function(tab,
# Issue #669: <0.001 gets printed as a tag in HTML
if (settings_equal("output_format", c("kableExtra", "html"))) {
for (i in seq_along(tab)) {
tab[[i]] <- gsub("<", "&lt;", tab[[i]])
tab[[i]] <- gsub(">", "&gt;", tab[[i]])
idx <- grepl("<[^>]*$", tab[[i]]) | grepl("^[^<]*>", tab[[i]])
# Brackets are not matching, perform substitution
tab[[i]][idx] <- gsub("<", "&lt;", tab[[i]][idx])
tab[[i]][idx] <- gsub(">", "&gt;", tab[[i]][idx])
}
}

Expand Down

0 comments on commit 1279fd0

Please sign in to comment.