Skip to content

When an error is rendered in the output, the ascii escape codes should be stripped or processed to HTML #4204

@kdheepak

Description

@kdheepak

Bug description

Currently when an error is rendered in the output, the ascii escape codes are also printed out

image

This is what it looks like in the terminal:

image

It would be nice if either quarto

  1. starts julia with the flag --color=no. This is the same output in the terminal with that flag

image

OR

  1. parses ascii codes in outputs using a javascript library to generate color html output. For example, you could vendor this: https://github.com/drudru/ansi_up

Reproducible example:

Create a _quarto.yml file:

project:
  type: website
  title: "MethodError"
  output-dir: _output
  execute-dir: project

execute:
  output: true
  echo: true
  warning: true
  error: true
  freeze: auto
  eval: true
  cache: true

jupyter: julia-1.8

Create a index.qmd file:

---
title: Method error
---

#### MethodError

```{julia}
ceil(1.2 + 2.3im)
```

Version information:

julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, tigerlake)
  Threads: 1 on 8 virtual cores

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingjuliatriaged-toIssues that were not self-assigned, signals that an issue was assigned to someone.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions