jariz / jariz/react-truncate-html

Long html not truncating

Open
#15 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
50
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Hi ,

HTML along with text is not truncating

see the below example
```javascript
import React from "react";
import "./styles.css";
import Truncate from "react-truncate-html";
export default function App() {
const content = `


User roles:
hello hello hello hello hello hello hello hello hello hello hello
hello hello hello THis is the hyperlinkhello hello
hello hello hello hello hello hello hello hello hello hello hello
hello hello hello hello 1111111 hello hello hello hello hello hello
hello hello hello hello hello hello hello hello hello hello hello
hello hello hello hello hello hello hello hello hello hello hello
hello hello hello 222222 hello hello hello hello hello hello hello
hello hello hello hello hello hello hello hello hello hello hello
hello hello hello hello hello hello hello hello hello hello hello
hello hello 333333 hello hello hello hello hello hello hello hello
hello hello hello hello hello hello hello hello hello hello hello
hello hello hello hello hello hello hello hello hello hello hello
hello 44444
`;
return (



);
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the example from the issue in the React entry point, using styles.css and the Truncate component with lines={2} and dangerouslySetInnerHTML. Trace why the supplied HTML and text are not truncated, and consider the issue resolved when this content renders within two lines while preserving its HTML structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.