Home > Blockchain >  How to make links clickable in text?
How to make links clickable in text?

Time:04-07

I develop a web app where users can post text, images, Files a post text can contain links also, for example

this is my webpage link: https://demo.com/page1/home

I store the above text in the database and I want to make https://demo.com/page1/home this text is clickable. What can I do..?

For example, I want something as follows

Comments use mini-Markdown formatting:

[link](http://example.com)

I store post text in a variable userPostObj.post_text

<mat-card-content>
        <pre >{{userPostObj.post_text}}</pre>
    </mat-card-content>

as above I use mat-card to display post.

CodePudding user response:

use the <a> & </a> tags - these tags define a hyperlink.

CodePudding user response:

Before you render the entire text, you have to wrap it with anchor tag <a> and add href property on it with text as its value.

<a href="https://demo.com/page1/home">https://demo.com/page1/home</a>
  • Related