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

Output of vroom::vroom does not display properly in Quarto HTML #537

Open
allefeld opened this issue Apr 28, 2024 · 4 comments
Open

Output of vroom::vroom does not display properly in Quarto HTML #537

allefeld opened this issue Apr 28, 2024 · 4 comments

Comments

@allefeld
Copy link

This is what it looks like in an R session in a terminal:

image

This is what it looks like in a Quarto document rendered to HTML:

image

I obviously don't expect the terminal colors to be reproduced. But beyond that, output seems to be out of order, line breaks are not respected etc.

In case this is a bug in Quarto and not in vroom, I'm tagging @cscheid.

@cscheid
Copy link

cscheid commented Apr 29, 2024

@allefeld Can you provide a minimal example I can run myself?

@allefeld
Copy link
Author

Here it is:

File test.qmd:

```{r}
df <- vroom::vroom("test.csv")
```

File test.csv (intentionally broken to trigger messages from vroom:

,Column 2,12
1,2,
,3,

Screenshot from rendered test.html:

image

Screenshot from same code run in a terminal:

image

Cell output HTML code:

<div class="cell-output cell-output-stderr">
<pre><code>New names:
Rows: 2 Columns: 3
── Column specification
──────────────────────────────────────────────────────── Delimiter: &quot;,&quot; dbl
(2): ...1, Column 2 lgl (1): 12
ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
Specify the column types or set `show_col_types = FALSE` to quiet this message.
• `` -&gt; `...1`</code></pre>
</div>

@cscheid
Copy link

cscheid commented Apr 29, 2024

Thanks. This is the output of keep-md: true for me (which is the input that Quarto takes from knitr's output, effectively). It doesn't look like there's much that Quarto can do at this point:

---
title: vroom-537
keep-md: true
---


::: {.cell}

:::

::: {.cell}

```{.r .cell-code}
df <- vroom::vroom("test.csv")
```

::: {.cell-output .cell-output-stderr}

```
New names:
Rows: 2 Columns: 3
── Column specification
──────────────────────────────────────────────────────── Delimiter: "," dbl
(2): ...1, Column 2 lgl (1): 12
ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
Specify the column types or set `show_col_types = FALSE` to quiet this message.
• `` -> `...1`
```


:::
:::

@allefeld
Copy link
Author

Agreed, seems like vroom creates its output in a strange way. Control characters to move the cursor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants