Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for newlines #214

Merged
merged 10 commits into from
Oct 17, 2023
Merged

Support for newlines #214

merged 10 commits into from
Oct 17, 2023

Conversation

Melkiades
Copy link
Contributor

Fixes #208

@Melkiades Melkiades added enhancement New feature or request sme Tracks changes for the sme board labels Oct 15, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2023

Unit Tests Summary

    1 files      4 suites   9s ⏱️
  33 tests   33 ✔️ 0 💤 0
227 runs  227 ✔️ 0 💤 0

Results for commit e322670.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2023

badge

Code Coverage Summary

Filename             Stmts    Miss  Cover    Missing
-----------------  -------  ------  -------  ----------------------------------------------------------------------------------------------------------
R/format_value.R       197      14  92.89%   94, 110-117, 197, 216, 287, 409, 420, 428
R/generics.R            98       4  95.92%   455, 467, 500, 529
R/labels.R              55       7  87.27%   53, 59, 68, 109, 137, 146, 150
R/matrix_form.R        427      27  93.68%   366-367, 462, 474-475, 494, 525, 614-615, 630-635, 662-663, 695-696, 728-729, 761, 847, 895, 947, 949, 952
R/mpf_exporters.R      124      12  90.32%   2, 84-86, 180, 220, 225, 408, 410, 415-416, 442
R/page_size.R           45       1  97.78%   169
R/pagination.R         479      22  95.41%   400, 472, 592-593, 598, 652-653, 671-679, 965, 972, 996-998, 1131-1132, 1144-1145, 1157-1158
R/tostring.R           499      25  94.99%   83, 135, 202, 236, 244-245, 280, 333-334, 423-425, 432-435, 604-605, 791, 886, 939, 980, 1025, 1080, 1087
R/utils.R                3       0  100.00%
TOTAL                 1927     112  94.19%

Diff against main

Filename           Stmts    Miss  Cover
---------------  -------  ------  -------
R/matrix_form.R      +11       0  +0.17%
R/tostring.R          +6       0  +0.06%
TOTAL                +17       0  +0.05%

Results for commit: e322670

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Comment on lines +21 to +30
# hack that is necessary only if bottom aligned
topleft_has_nl_char <- FALSE
if (has_topleft) {
tl <- strmat[hdr_inds, 1, drop = TRUE]
strmat[hdr_inds, 1] <- ""
tl <- tl[nzchar(tl)] # we are not interested in initial "" but we cover initial \n
topleft_has_nl_char <- any(grepl("\n", tl))
tl_to_add_back <- strsplit(paste0(tl, collapse = "\n"), split = "\n", fixed = TRUE)[[1]]
how_many_nl <- length(tl_to_add_back)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would not be necessary if it is aligned top, and it is a bit of a hack

}
newstrmat[1:new_nlines_hdr, 1] <- c(newtl, rep("", new_nlines_hdr - length(newtl)))
newfrmmat[1:new_nlines_hdr, 1] <- "xx"
newstrmat[starts_from_ind + seq_along(tl_to_add_back), 1] <- tl_to_add_back
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar as before, but I tried so many other ways, if we leave it bottom this is the only way that actually works

@edelarua edelarua self-assigned this Oct 16, 2023
@shajoezhu shajoezhu enabled auto-merge (squash) October 17, 2023 02:37
Copy link
Contributor

@shajoezhu shajoezhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! approve pr to allow downstream uat

@shajoezhu shajoezhu merged commit 49f4ac3 into main Oct 17, 2023
24 checks passed
@shajoezhu shajoezhu deleted the 208_support_for_newline@main branch October 17, 2023 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sme Tracks changes for the sme board
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fixing \n in row and column labels (i.e. allowing it)
3 participants