Multiple Links Inside Same Google Sheet Cell


I have a cells that have multi-line of text including multiple hrefs that I’d like to turn into clickable links. I can “format” the cell by clicking on the text of the href and clicking on another cell. How do I do this in a scalable way for all cells?

https://google.com
https://yahoo.com
text line
another text line

I want to turn google and yahoo into clickable links.

I’ve tried to replace https:// with =HYPERLINK(" and .com with ") but gave me formula error.