Truncate inner html

I am using a summernote box in one of my forms so in order to display the result of the text field in my page I have to use inner html. When I try to use the Data Format truncate nothing displays. I’ve notice a lot of the Data Format function don’t work with inner html, is there a work around for this?

Are there any errors in the browser console?

No, nothing.

The page is set like this:

The output in the browser console is simply

If you want to post code in your posts, so that we can see it please follow:

And also the truncate formatter works perfectly fine with the dmx-html attribute, so there must be something wrong on your page.
Please double check if your expression returns any data at all and also double check the console for errors.

No, nothing.

The page is set like this:
<p dmx-html="blog_desc.trunc(120, 'true', '...')"></p>

The output in the browser console is simply
<p></p>

There are no errors showing.

Are you sure <p dmx-html="blog_desc"></p> returns a value then?
Can you post a screenshot of the browser dev tools > Console so i can see if there are any errors?

Wappler showing paragraph using dmx-html and truncate, nothing shows and paragraph just using dmx-html and text is shown correctly.

This image shows browser console, paragraph using truncate just shows as <p></p> whereas paragraph not truncate displays as expected

Do you have a live link to this page where i can check this?

Have you tried stripping the tags (formatter) then truncating? We do similar to shorten blog posts created in Summer Note.

<p dmx-html="blogHeaderSectionContent.stripTags().trunc(200, 'true', '...')" class="fw-normal"></p>

Well your blog_desc returns:


a few more page i won’t post here …

literally TONS of rubbish/unnecesary HTML tags and code and like 1 line of text. Not sure how did you manage to generate and store this HTML in the database but you should look into clearing it.

You don’t need any of those in the style tag for your paragraph.

Just used Wappler and added a Summernote to my form…

    <textarea id="desc" name="desc" is="dmx-summernote" dmx-bind:toolbar="[['style',['style']],['font',['bold','underline','clear']],['fontname',['fontname']],['color',['color']],['para',['ul','ol','paragraph']],['table',['table']],['insert',['link','picture','video']],['view',['fullscreen','codeview','help']]]" dmx-bind:value="scblogdetails.data.blog[0].blog_desc"></textarea>

I did wonder what all the garbage was, thought Wappler added it!

No, Wappler does not add such html/styling. Have you maybe copy-pasted this text in the summernote from some other site or word document?