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

Improve the Paste from Office behaviour while using Text part language #12672

Closed
Mgsy opened this issue Oct 18, 2022 · 7 comments · Fixed by #13804
Closed

Improve the Paste from Office behaviour while using Text part language #12672

Mgsy opened this issue Oct 18, 2022 · 7 comments · Fixed by #13804
Assignees
Labels
package:paste-from-office squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:improvement This issue reports a possible enhancement of an existing feature.

Comments

@Mgsy
Copy link
Member

Mgsy commented Oct 18, 2022

📝 Provide detailed reproduction steps (if any)

  1. Copy the example Word document content.
  2. Paste it to the editor with Text part language and Paste from Office plugins (e.g. all-features manual test).

✔️ Expected result

The content doesn't have an italic style.

❌ Actual result

The content has an italic style.

📃 Other details

MS Word wraps each text in <span lang=""> so our Text part language feature kicks in, preserves the content and adds font-style:italic property.

Translates to:

<p class=MsoNormal><span lang=EN-US>test<o:p></o:p></span></p>

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@Mgsy Mgsy added type:improvement This issue reports a possible enhancement of an existing feature. package:paste-from-office support:2 An issue reported by a commercially licensed client. squad:core Issue to be handled by the Core team. labels Oct 18, 2022
@simulat0r
Copy link

👍

1 similar comment
@jimmyhoeEm2ai
Copy link

👍

@Reinmar
Copy link
Member

Reinmar commented Mar 6, 2023

If anyone's wondering how to change the language in MSWord, the option is in the bottom bar:

@Reinmar
Copy link
Member

Reinmar commented Mar 6, 2023

We are consider stripping lang=* from the content coming from Word. That's what CKE4 and Tiny do. However, that's inoptimal for two reasons:

  • This is actually a valuable information that we're losing. E.g. in a mix language content, the information about the language can help with e.g. spellcheck.
  • We should not strip the dir attribute because it has even greater impact on the browser behavior.

We'll need to do a bit better research regarding the optimal aproach.

@Witoso
Copy link
Member

Witoso commented Mar 10, 2023

tl;dr after a bit of a research., I think the main task here is just to remove the italics style on the text in other languages (Text part language plugin). 

To the points mentioned above, in our model's language attribute, we keep a pair in a form of: lang:dir (e.g. ar:rtl. es:ltr) so we shouldn't strip values.

Taking it from the user's perspective:

  1. The editor is enabled with the text part and paste plugins (I expect those features to work).
  2. I paste the content in multiple languages from Word.
  3. I have multiple languages in my editor.

To this, we add no. 4: Languages have italics style to distinguish them. I feel this is a wrong assumption. Not only do we style in italics but we also prevent removing italics which may result in bigger confusion and breaks a bit WYSIWYG idea.

To refer to Word/Pages, those tools do language autodetection but don't distinguish them in the editor UI. In Word's case, you see language in the bottom toolbar, and Pages is not showing it to you at all.

In the CKEditor case language distinction will be visible in the configured toolbar which is in my opinion enough.

@Witoso
Copy link
Member

Witoso commented Mar 28, 2023

@Reinmar @oleq, would love to hear your UX opinion.

@Witoso Witoso removed their assignment Mar 29, 2023
@Witoso
Copy link
Member

Witoso commented Mar 29, 2023

Let's remove the italics (style) and add to the docs information on how to style it by yourself.
Minor BC.

@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Mar 29, 2023
@arkflpc arkflpc self-assigned this Mar 31, 2023
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Mar 31, 2023
arkflpc added a commit that referenced this issue Apr 4, 2023
…extpartlanguage

Other (language): TextPartLanguage doesn't style text as italic when language is set. Closes #12672.

MINOR BREAKING CHANGE (language): Text with language set is no longer styled as italic. To re-enable previous behavior, add style .ck-content span[lang] { font-style: italic;  } to your css.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Apr 4, 2023
@CKEditorBot CKEditorBot added this to the iteration 62 milestone Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:paste-from-office squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants