We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the text includes characters like \n\r or <br/> or Text that are surrounded with <p>. It would not be converted into line breaks.
\n\r
<br/>
<p>
The text was updated successfully, but these errors were encountered:
I'm looking for the same feature
Sorry, something went wrong.
Need the same feature here
Had the same issue. I used \n line breaks and CSS to fix the issue To fix, use something like this:
import React from "react"; import TextTruncate from "react-text-truncate"; import "./styles.css"; const TruncatedText = () => { const content = "Your long text goes here...\nWith line breaks."; return ( <div> <TextTruncate line={3} element="span" truncateText="..." text={content} containerClassName="text-truncate" /> </div> ); }; export default TruncatedText ;
Then in your CSS,
.text-truncate { white-space: pre-line; }
No branches or pull requests
When the text includes characters like
\n\r
or<br/>
or Text that are surrounded with<p>
. It would not be converted into line breaks.The text was updated successfully, but these errors were encountered: