Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#37808 closed defect (bug) (fixed)

Zero-width space stripped by TinyMCE again

Reported by: nathanwells's profile nathanwells Owned by: iseulde's profile iseulde
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.6
Component: TinyMCE Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Starting from Wordpress 4.3.x TinyMCE started stripping out zero-width spaces (\u200B) from posts which essentially destroys line-break formatting in the Khmer language (especially on mobile devices). This bug was removed once already four years ago (#21025) and so it is a regression. We've alerted the TinyMCE team on GitHub but also wanted to alert the Wordpress team so we can see this fixed.

Change History (14)

#1 follow-up: @iseulde
8 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Thanks for the report and welcome to Trac! Is this problem new to 4.6?

I see the GitHub issue was acknowledged by TinyMCE in April.

We are also using that character for the text patterns, but it is carefully inserted and removed again. We are not removing just any character. We should maybe use \uFEFF though if the other is used in some languages, but I'm not sure if there were any problems with that one.

#2 @iseulde
8 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 4.6.1

Fix from TinyMCE: https://github.com/tinymce/tinymce/commit/1696e387e818d9c3f4e2e2d8871f0218208a0212
Let's consider it for 4.6.1 with the other TinyMCE fixes, otherwise it will be for 4.7.

#4 in reply to: ↑ 1 @nathanwells
8 years ago

Replying to iseulde:

Thanks for the report and welcome to Trac! Is this problem new to 4.6?

No, it is not new - started in Wordpress 4.3.x but since the but was only posted in the TinyMCE GitHub I thought it would be good to bring attention to it here as well since it impacts Wordpress (and since the previous time this happened, it was dealt with here). Also it is not new in the fact that it was fixed once already, but now the code has regressed and needs to be patched again.

We are also using that character for the text patterns, but it is carefully inserted and removed again. We are not removing just any character. We should maybe use \uFEFF though if the other is used in some languages, but I'm not sure if there were any problems with that one.

I would think using \uFEFF could be a good option for us (the Khmer language). Based on Wikipedia, some languages used to use \uFEFF as a type of zero-width space but that has now been depreciated, and it is used exclusively as the BOM Wikipedia:Word Joiner and Unicode FAQ

Appreciate your time on this!

#5 @nathanwells
8 years ago

Just saw the patch - wonderful! Thank you @iseulde and spocke!

#6 @swissspidy
8 years ago

  • Owner set to iseulde
  • Status changed from new to assigned

#7 follow-up: @azaozz
8 years ago

IMHO we should patch this in 4.6.1. That means we will have to push an update to TinyMCE which might cause some "caching jitters" on a few sites for a day, but having the editor strip a character that was typed by the users is a "high impact" bug.

Thinking best would be to backport the above fix to the current TinyMCE version in 4.6. That way we will minimize any possibilities of breaking something else in 4.6.1.

#8 @SergeyBiryukov
8 years ago

  • Description modified (diff)

#9 in reply to: ↑ 7 @azaozz
8 years ago

  • Keywords has-patch removed

Replying to azaozz:

Turns out this is not that simple. Changing the zero-width space char (placeholder) in TinyMCE requires other changes and fixes, most for IE. See https://github.com/tinymce/tinymce/commit/16750c20fdba279ff98f0e45aea5e859b1384e27.

In that terms we would have to backport several changes that are (mostly) untested in WordPress. Not sure this is good for a dot release. This would have been very nice to fix but is not a regression from 4.5. Seems better to leave it for 4.7.

This ticket was mentioned in Slack in #core-editor by azaozz. View the logs.


8 years ago

#11 @azaozz
8 years ago

  • Milestone changed from 4.6.1 to 4.7

This is fixed upstream and will be fixed in WordPress when we update TinyMCE in 4.7.

#12 @jorbin
8 years ago

@azaozz Do you already have a plan for when you are going to update TinyMCE in 4.7?

#13 @jorbin
8 years ago

I've opened #38081 to update TinyMCE which should resolve this issue.

#14 @azaozz
8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.