react-pdf-html icon indicating copy to clipboard operation
react-pdf-html copied to clipboard

List text is broken up by hyphens

Open rohit8 opened this issue 1 year ago • 2 comments

I'm seeing this html rendering issue with v2.0.4.

Given children:

<ul><li>Testing 1 2 3</li></ul>

The list text is unnecessarily broken up on to new lines.

Screenshot 2024-06-15 at 9 08 24 PM

While paragraph text renders correctly:

<p>Testing 1 2 3</p>

Output:

Screenshot 2024-06-15 at 9 09 56 PM

Other dependencies: react-pdf: 9 @react-pdf/renderer: 3.4.4

rohit8 avatar Jun 16 '24 01:06 rohit8

@rohit8 is your Html element wrapped in other react-pdf elements? I wonder if it's inheriting parent styles or being constrained by a parent width.

danomatic avatar Jul 21 '24 21:07 danomatic

@rohit8 I had the same issue with li tags

Solved by setting specific width for the Html element - <Html style={{ width: '100%' }}>{description}</Html> Either downgrade to the 1.1.21 version

@danomatic https://github.com/danomatic/react-pdf-html/commit/2b9d02e58d687dc1d6b1439b09dd5ed470466df5 image

vdor avatar Aug 02 '24 16:08 vdor