Truncate not working with formatted text (html code)
See original GitHub issueI’m making a little blog website and on the index page I have a list of posts but I don’t want to see all posts content so I used <p class='truncate'>{{ post.content }}</p>
but it’s not working.
Is that a bug or just it’s not possible to do .truncate with content in basic html code?
Issue Analytics
- State:
- Created 8 years ago
- Comments:8
Top Results From Across the Web
How to truncate an html text and still maintain the format, in PHP
An easy way would be to do it using javascript, but a solution using php is possible if you got the tags +...
Read more >Unable to truncate lightning:formattedRichText text
I have a problem with a lightning:formattedRichText element. Below my code ... it displays the result as an html code with p and...
Read more >Apply safe truncate HTML behavior by default on rich text fields
In the code, detect whether a field uses formatted text. If so, skip HTML markup in the character count. Remaining tasks. Discuss pros...
Read more >PHP: Truncating Text - The Art of Web
One solution is to truncate the text so that it fits on the page. This sounds simple, but often the results aren't as...
Read more >Text · Bootstrap v4.6
For longer content, you can add a .text-truncate class to truncate the text with an ellipsis. Requires display: inline-block or display: block ....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
you can refer to this link: https://codepen.io/j_holtslander/pen/wmgKea
Conclusion:
e.g.
don’t use truncate, instead you can use native ‘text-overflow: ellipsis’.