nbpreview icon indicating copy to clipboard operation
nbpreview copied to clipboard

Apply ansi_up to "text" output

Open jmsos opened this issue 4 years ago • 5 comments
trafficstars

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

jmsos avatar Sep 15 '21 11:09 jmsos

Thanks for suggesting this, Justin! I think that's a very reasonable proposal. I'll look into incorporating this while not degrading the rendering for other text output cells.

jsvine avatar Oct 15 '21 22:10 jsvine

is there an update on this issue ?

chandhana520 avatar Jan 14 '22 11:01 chandhana520

@chandhana520 I haven't had the time to write or (especially) test code that would achieve this yet. But it does still seem worthwhile.

jsvine avatar Jan 20 '22 03:01 jsvine

How can i use nbpreview for my vue application

chandhana520 avatar Jan 24 '22 06:01 chandhana520

Hello, just checking in on whether there has been any progress with this issue?

srmibextesting avatar Feb 21 '23 09:02 srmibextesting