Skip to content

Commit

Permalink
Proper coloring by converting each output line separately
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jan 13, 2019
1 parent f662351 commit 32d6829
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 86 deletions.
9 changes: 8 additions & 1 deletion content/articles/2019-01-tibble-2-0-1.Rmarkdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ options(crayon.enabled = TRUE)
```

```{r setup-hooks, comment="", results="asis", echo=FALSE}
old_hooks <- fansi::set_knit_hooks(knitr::knit_hooks, which = c("output", "error"))
old_hooks <- fansi::set_knit_hooks(
knitr::knit_hooks,
which = c("output", "error"),
proc.fun = function(x, class) {
x <- strsplit(x, "\n", fixed = TRUE)[[1]]
fansi::html_code_block(fansi::sgr_to_html(fansi::html_esc(x)), class = class)
}
)
```


Expand Down
Loading

0 comments on commit 32d6829

Please sign in to comment.