Skip to content

Commit

Permalink
Import whole of multiline comments (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
nacnudus committed Feb 13, 2017
1 parent 2dcf48e commit 96df3bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/xlsxsheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void xlsxsheet::cacheComments(Rcpp::String comments_path) {
for (rapidxml::xml_node<>* comment = commentList->first_node();
comment; comment = comment->next_sibling()) {
std::string ref(comment->first_attribute("ref")->value());
rapidxml::xml_node<>* r = comment->first_node()->first_node();
rapidxml::xml_node<>* r = comment->first_node();
// Get the inline string
std::string inlineString;
parseString(r, inlineString); // value is modified in place
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-comments.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
context("Comments")

test_that("multiline comments are returned in full", {
expect_equal(tidy_xlsx("examples.xlsx")$data$Sheet1$comment[19],
"commentwithtextformatting")
})

0 comments on commit 96df3bd

Please sign in to comment.