0
votes

While working on the project, i found an issue : "When texts with certain format is copied, it should be pasted to replace the formatting of whichever line of text it will be placed in"

Steps To Reproduce

  • Copy unbolded text
  • Go to line with bolded text
  • Paste next to that word or paste by pressing enter to move in next line.

Current behavior -Underlined UNBOLDED text is also bold when paste next to bolded text.

Expected behavior -Underlined UNBOLDED text should be underlined and unbolded after paste.

Used: Tinymce version : 4.6.6

Same Thing i have tested in MS Word or any other text editor, the expected output is not same as the tinymce. So i have reported this as an issue github link

Please help Thank you.

1

1 Answers

1
votes

This is working as expected. When you copy text with underline applied you are copying HTML like following:

<span style="text-decoration: underline;">fadsfasdfasd</span>

If you then paste that anywhere else in your document you have that HTML within the paragraph in question such as:

<p>
  <strong>fadsfasdfasdfa
    <span style="text-decoration:underline;">fadsfasdfasd</span>
  </strong>
</p>

So the net result is the outer strong tag also impacts the pasted text. This is simply how HTML works and is the expected behavior.