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

Any chance for multiline support?

Open tariano opened this issue 3 years ago • 1 comments

i.e. replace \ns with <br>s?

tariano avatar Apr 25 '21 17:04 tariano

The issue seems old but good issue

I have solved this problem. https://stackoverflow.com/questions/36260013/react-display-line-breaks-from-saved-textarea

Using css method


 <Linkify
       componentDecorator={(decoratedHref, decoratedText, key) => (
         <a
           target="blank"
           rel="noopener noreferrer"
           href={decoratedHref}
           key={key}
         >
           {decoratedText}
         </a>
       )}
     >
       <div
         style={{
           whiteSpace: "pre-line",
         }}
       >
         {children}
       </div>
     </Linkify>

Also I added open in new tab functionality, thanks to https://github.com/tasti/react-linkify/issues/96#issuecomment-628472955

emindeniz99 avatar Oct 20 '21 17:10 emindeniz99