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

Couple of fixes for Word Online Paste #1965

Merged
merged 7 commits into from
Jul 21, 2023

Conversation

BryanValverdeU
Copy link
Contributor

@BryanValverdeU BryanValverdeU commented Jul 20, 2023

For some reason, table container have negative margin in Word Online. Which causes the table to look truncated when pasted into rooster.
Remove that margin on paste when the source is Word Online

Before
image

After
image

Second bugfix is to keep the EOP Elements when pasting from Word Online since these elements can sometimes be present in new lines, and if we remove them can cause that the paste result will not have some new lines. (https://outlookweb.visualstudio.com/Outlook%20Web/_workitems/edit/218022/)

element: HTMLElement
) => {
if (element.classList.contains(TABLE_CONTAINER) && element.style.marginLeft.startsWith('-')) {
element.style.marginLeft = '0px';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should change this margin value here. Normally a parser should not modify source element.

Does it still work if we don't change the margin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I understand why this was not working. I should have been using the container formatParser instead of the block format parser.

Just removed this line

@BryanValverdeU BryanValverdeU changed the title Remove Negative Margin on Table Container, causing the Table to look truncated Couple of fixes for Word Online Paste Jul 20, 2023
@BryanValverdeU BryanValverdeU merged commit 87b6480 into master Jul 21, 2023
@JiuqingSong JiuqingSong deleted the u/bvalverde/tableBugWordOnline branch September 8, 2023 22:35
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