Solution 1 :

I’m guessing your prop question.description already has the p tag on the string.

Angular also has innerText so you can try: <span [innerText]="question.description" ...

Problem :

Hello here is my code –

<span  [innerHtml]="question.description | SafePipe: 'html'" style="font-weight:500;" class="ml-1"></span>

On my website when inspected i see my span tag contains <p> tags in which i get the whole text

<span>
    <p>  </p> </span>

i want to replace inner <p> tags with <span> tag. How can i achieve this in angular 8

Comments

Comment posted by fuzzyprototype

hi, we are uploading data from a text editor which is build as another application. so with [innerText] I get my padding issue solved but I get the whole html tags.. for example –

Content .. .. .. … . . . …

Comment posted by Vetras

so my assumption is true. you have html on your string. If you cant change the src data, I don’t know…

Comment posted by fuzzyprototype

yeah, we are unable to change it. still looking for answers.

By

Leave a Reply

Your email address will not be published. Required fields are marked *