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

Keep start property and marker (if supported) when copying list from WordOnline #1200

Merged
merged 7 commits into from
Aug 25, 2022

Conversation

BryanValverdeU
Copy link
Contributor

@BryanValverdeU BryanValverdeU commented Aug 25, 2022

When copying lists from Word Online, sometimes the marker is not saved and the start of the list is reset:

For example, this content in Word Online
image

Gets pasted like this in Rooster: With this change, we add support to keep the list start property and also the marker type if it is supported and mantain the start property of the lists
image image

Some of the Word Online markers in the clipboard are unsupported. If I tried to use them the marker would look bad, so only can support some of the Word Online Markers

Word Online RoosterJS
Screenshot 2022-08-24 152244 Screenshot 2022-08-24 152400

Why some of the markers are not supported:
The clipboard provided from WordOnline does not contain the data-leveltext hence we cannot use it to change the list marker
image

@BryanValverdeU BryanValverdeU changed the title Keep start property and marker (if supported) from WordOnline Keep start property and marker (if supported) when copying list from WordOnline Aug 25, 2022
@BryanValverdeU BryanValverdeU marked this pull request as draft August 25, 2022 14:12
@BryanValverdeU BryanValverdeU self-assigned this Aug 25, 2022
@BryanValverdeU BryanValverdeU marked this pull request as ready for review August 25, 2022 15:36
this.listTypes.pop();
}

if (this.listTypes[listTypesLength - 1] == ListType.Ordered) {
this.node.style.listStyleType = '';
Copy link
Contributor

Choose a reason for hiding this comment

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

why set to empty? What if the parent level list also have a list style type, should we also follow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this part of code as the scope of this PR is only going to be pasting from Word Online.
However, I found that if a list have a 'custom' list style type and we indent or outdent, Vlist is going to remove the list style and will have a different list style. Adding a gif to explain better:

WordPast2

Copy link
Contributor

Choose a reason for hiding this comment

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

So this should be a separate issue, right?
Does it repro without this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, separate issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok. please open issue to track.

@BryanValverdeU BryanValverdeU merged commit fe1f775 into master Aug 25, 2022
@JiuqingSong JiuqingSong deleted the u/bvalverde/copyPasteFromWordf1 branch October 31, 2022 19:23
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.

Start property and marker lost when copying list from WordOnline #1200
2 participants