Skip to content

Commit 79a66ac

Browse files
oliviermeslincderv
andauthored
Add the position of the last character (#2146)
* Add the position of the last character * Add a NEWS bullet * Bump version Co-authored-by: christophe dervieux <christophe.dervieux@gmail.com>
1 parent 55b5bb8 commit 79a66ac

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rmarkdown
22
Type: Package
33
Title: Dynamic Documents for R
4-
Version: 2.8.3
4+
Version: 2.8.4
55
Authors@R: c(
66
person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"),
77
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
rmarkdown 2.9
22
================================================================================
33

4+
- Fixed an issue with `copy_ressource = TRUE` in `html_document_base` where very long HTML documents were truncated during post processing (thanks, @oliviermeslin, #2145).
5+
46
- When rendering a `runtime: shiny` document, an extra temp folder will be used in the output path. With the extra temp random folder in the path, predictable output file names may be used. (#2137)
57

68
- Floating ToC in `html_document` can now hide headings with unnumbered and unlisted classes (thanks, @atusy, #1993).

R/html_resource_copy.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,11 @@ copy_resources <- function(input_str, lib_dir, output_dir, resource_locator) {
102102

103103
# the text from the current replacement to the end of the output,
104104
# if applicable
105-
after <- if (res_rep == length(res_replacements))
106-
substring(input_str, ch_pos)
107-
else
105+
after <- if (res_rep == length(res_replacements)) {
106+
substring(input_str, ch_pos, last = nchar(input_str, type = "bytes"))
107+
} else {
108108
""
109+
}
109110

110111
# compose the next segment of the output from the text between
111112
# replacements and the current replacement text

0 commit comments

Comments
 (0)