Can I avoid truncating lines in the rendered view of a cell?

I made a small helper for when I am working with Nepali documents that need to be converted from ASCII into Unicode. The outputs are rendered (unformatted) into a cell as such:

This is great for short texts, however for longer texts the output is truncated. I would like to avoid truncation b/c it’s always an extra click before I can copy-and-paste large outputs.

This view of the cell content, in my understanding, is controlled by the inspector. I’ve been digging around the inspector code on GitHub, but can’t identify where this behavior is set. Can anyone help to point me to the right place and/or suggest a quick and dirty override?

Thank you!

You can find the implentation here, but that won’t help you much since you cannot override the limit.

I’d recommend to wrap your output in a helper:

sview = str => {
  const t = html`<textarea style="width:100%" readonly>${DOM.text(str)}`;
  t.value = str;
  t.onfocus = () => t.select(); // select everything on focus
  return t;
}
viewof output_raw = sview(preeti_local(text))
2 Likes

Very cool! Thank you @mootari!