Skip to content
New issue

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

Word Desktop LineHeight fix on paste #2677

Merged
merged 5 commits into from
May 31, 2024

Conversation

BryanValverdeU
Copy link
Contributor

@BryanValverdeU BryanValverdeU commented May 31, 2024

Word Desktop set the line lineheight as percentages based on the At least property.
For example if in Word you set 1.16 line height after paste the value is going to be 116% in the HTML clipboard.
The problem here is that in Browser the default line height is 1.2/120% (according to https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#normal) so if you set the value as 116% instead of having a bigger line height the line height in the browser is going to look smaller.

So change the way how we parse the line height when pasting from Word Desktop and use the line Height percentage value and multiply it by the Browser default line height.

Word Document used for test:
image

Before (Notice how the 1.16 line height paragraph look smaller than the 1 paragraph, because of the issue)
image

After (1.16 now looks with bigger line height than the "1" lineheight paragraph)
image

@BryanValverdeU BryanValverdeU changed the title Word Desktop LineHeightfix Word Desktop LineHeight fix on paste May 31, 2024
@BryanValverdeU BryanValverdeU merged commit 293f512 into master May 31, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants