Skip to content

Commit c60bf90

Browse files
Revert "trim white space as last serialization step"
This reverts commit 3b193f0.
1 parent 4cc9382 commit c60bf90

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

R/serialize.R

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ serialize_parse_data_nested_helper <- function(pd_nested, pass_indent) {
3131

3232
#' Serialize a nested parse table
3333
#'
34-
#' Collapses a nested parse table into its character vector representation and
35-
#' removes trailing white spaces.
34+
#' Collapses a nested parse table into its character vector representation.
3635
#' @param pd_nested A nested parse table with line break, spaces and indention
3736
#' information.
3837
#' @return A character string.
@@ -49,8 +48,7 @@ serialize_parse_data_nested <- function(pd_nested) {
4948

5049
#' Serialize Flat Parse Data
5150
#'
52-
#' Collapses a parse table into character vector representation and
53-
#' removes trailing white spaces.
51+
#' Collapses a parse table into character vector representation.
5452
#' @param pd_flat A parse table.
5553
#' @details
5654
#' The function essentially collapses the column text of `pd_flat`
@@ -68,14 +66,12 @@ serialize_parse_data_flat <- function(pd_flat) {
6866
collapse = "")) %>%
6967
.[["text_ws"]] %>%
7068
strsplit("\n", fixed = TRUE) %>%
71-
.[[1L]] %>%
72-
trimws(which = "right")
69+
.[[1L]]
7370
}
7471

7572
#' Serialize flattened parse data
7673
#'
77-
#' Collapses a flattened parse table into character vector representation and
78-
#' removes trailing white spaces.
74+
#' Collapses a flattened parse table into character vector representation.
7975
#' @param flattened_pd A flattened parse table.
8076
serialize_parse_data_flattened <- function(flattened_pd) {
8177
flattened_pd$lag_newlines[1] <- flattened_pd$line1[1] - 1
@@ -88,8 +84,7 @@ serialize_parse_data_flattened <- function(flattened_pd) {
8884
collapse = "")) %>%
8985
.[["text_ws"]] %>%
9086
strsplit("\n", fixed = TRUE) %>%
91-
.[[1L]] %>%
92-
trimws(which = "right")
87+
.[[1L]]
9388

9489

9590
}

man/serialize_parse_data_flat.Rd

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

man/serialize_parse_data_flattened.Rd

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

man/serialize_parse_data_nested.Rd

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

0 commit comments

Comments
 (0)