Skip to content

Apply ansi_up to "text" output #6

@jmsos

Description

@jmsos

Almond and others output ansi-formatted text as "text/plain"
ex. https://github.com/almond-sh/almond/blob/master/examples/plotly-scala.ipynb
GitHub filters this out (without highlighting), but nbpreview is currently not even doing the filtering. This results in garbled text:
image

I would recommend applying at least the filtering of ansi, possibly the highlighting as well. I made the following tweak locally:
nb.display.text=function(text){var el=makeElement("pre",["text-output"]);el.innerHTML=nb.highlighter(nb.ansi(joinText(text)),el);return el}

Resulting in:
image

Best
Justin

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions