ansi-to-react icon indicating copy to clipboard operation
ansi-to-react copied to clipboard

Add support to return a span element without a code wrap

Open resaldiv opened this issue 4 years ago • 2 comments

Currently, it seems that React can't handle the memory pressure when a large output of text is being rendered. This PR is part of the solution for this issue and adds a new prop that indicates whether Ansi should return a span element without a code wrap.

resaldiv avatar Oct 20 '20 22:10 resaldiv

Is there a reason to support this (eg, what's the use case)? Semantically, code is almost always the correct choice.

Also, the pattern I've seen for this stuff out "in the wild" is using an as prop (Reach UI is the example that comes to mind). So instead of <Ansi spanify /> you'd use <Ansi as="span" />.

twavv avatar Oct 21 '20 00:10 twavv

Yes, I just opened this issue that explains in a better way the reason to support this and updated the description of this PR.

Thanks for the suggestion! I'm going to change the prop, to follow the pattern you mentioned.

resaldiv avatar Oct 22 '20 20:10 resaldiv