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

Raw Handling: List pasted from Word gets lost #46832

Closed
Soean opened this issue Dec 30, 2022 · 3 comments · Fixed by #55127
Closed

Raw Handling: List pasted from Word gets lost #46832

Soean opened this issue Dec 30, 2022 · 3 comments · Fixed by #55127
Assignees
Labels
[Block] List Affects the List Block [Feature] Paste [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@Soean
Copy link
Member

Soean commented Dec 30, 2022

Description

When I paste a list from a Word document, it gets lost.

Word:

Example file
example.docx

Received HTML:

<h3><a name="_Hlk64885792">This is a headline?<o:p></o:p></a></h3>

<p class=MsoNormal><span style='mso-bookmark:_Hlk64885792'>This is a text:<o:p></o:p></span></p>

<p class=MsoListParagraphCxSpFirst style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><span
style='mso-bookmark:_Hlk64885792'><![if !supportLists]><span style='font-family:
Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>One <o:p></o:p></span></p>

<p class=MsoListParagraphCxSpMiddle style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><span
style='mso-bookmark:_Hlk64885792'><![if !supportLists]><span style='font-family:
Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>Two<o:p></o:p></span></p>

<p class=MsoListParagraphCxSpLast style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><span
style='mso-bookmark:_Hlk64885792'><![if !supportLists]><span style='font-family:
Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>Three<o:p></o:p></span></p>

<span style='mso-bookmark:_Hlk64885792'></span>

<p class=MsoNormal><a name="_Hlk64885540">Lorem Ipsum. </a><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Calibri",sans-serif;mso-ascii-theme-font:
minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'><o:p>&nbsp;</o:p></span></p>

Received plain text:

 This is a headline?
This is a text:
•	One 
•	Two
•	Three
Lorem Ipsum.

Processed HTML piece:

 <h3><a>This is a headline?</a></h3><p>This is a text:</p><p><a>Lorem Ipsum.</a></p>
@Soean Soean changed the title List pasted from Word is lost List pasted from Word gets lost Dec 30, 2022
@kathrynwp kathrynwp added the [Type] Bug An existing feature does not function as intended label Jan 3, 2023
@kathrynwp
Copy link

related: #46803

@annezazu annezazu changed the title List pasted from Word gets lost Raw Handling: List pasted from Word gets lost Aug 3, 2023
@annezazu annezazu added the [Block] List Affects the List Block label Aug 3, 2023
@annezazu annezazu moved this to Needs Dev / Todo in WordPress 6.4 Editor Tasks Aug 30, 2023
@t-hamano
Copy link
Contributor

I was able to reproduce the exact same problem using the Word file attached by @Soean.

However, when I created a new Word file on my machine and created the exact same content, it pasted correctly. Could it be related to the OS, Office version, or document settings on which the Word file was created? 🤔

f91f989a321bf2c827f6dd476b2bebbe.mp4

@ellatrix
Copy link
Member

ellatrix commented Oct 6, 2023

Thanks for providing the received HTML. #55127 should fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block [Feature] Paste [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants