0
votes

i have inputted value using ckeditor but i'm getting html tags along with the document how can i show only text

this is my input formant and how i want to show https://prnt.sc/11a6em6

this is my output format https://prnt.sc/11a6mdv

this is code to display the text

{{#each about}}
    <div class="theme-title-one">
        <h2>{{this.title}}</h2>
        <p>{{this.description}}<p>
    </div>
{{/each}}   

text i'm getting on the display side is

<h3><strong>New updates to  program</strong></h3><h4><strong>1.
</strong><i><strong>target sectors have been
 expanded.</strong></i></h4><p>When the program was launched in
 2019, applicants under seven target sectors were accepted. These
 sectors were as follows:</p>

i want to display is

New updates to program

1. target sectors have been expanded.

When the program was launched in 2019, applicants under seven target sectors were accepted. These sectors were as follows:

1

1 Answers

0
votes

If you need the data to be structured then you need to break them up and not use a RTE. The point of an RTE is to allow you to create rich text, so the editor will always insert html, thats the point.

To do what you want to do, you COULD, not that you should parse the response with regex and pull out the H3 as the title and body etc..

This method can work but is a pain.

If the data is to always be in the format you want then you should add a 'title' and 'description' to the DB table, this way you can always get a clean title and body.

Without knowing how things are structured or the use case its a bit difficult to tell but that would be a better way of doing it.