question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Truncate not working with formatted text (html code)

See original GitHub issue

I’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:closed
  • Created 8 years ago
  • Comments:8

github_iconTop GitHub Comments

3reactions
cw-devanshvermacommented, Dec 15, 2018

you can refer to this link: https://codepen.io/j_holtslander/pen/wmgKea

Conclusion:

In order to use truncate class you have to use grid

e.g.

<div class="row">
    <div class="col s4">
        <p class="truncate">This is a fairly long .flow-text title in Materialize framework.</p>
    </div>
</div>
0reactions
jpnayakcommented, Dec 4, 2016

don’t use truncate, instead you can use native ‘text-overflow: ellipsis’.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found