Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#28302 closed defect (bug) (duplicate)

All text disappears from view when one line ends with a-grave, then saving a draft from visual editor

Reported by: niente0's profile niente0 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Formatting Keywords: dev-feedback wpautop
Focuses: Cc:

Description

Hello, these are the steps to reproduce the bug:

  • new article, text editor
  • copy-paste these 3 lines (accented letter included):

line one
line twoà
line three

  • click on visual editor
  • save draft

The text disappears. How to fix it?

Change History (14)

#1 @bi0xid
11 years ago

  • Resolution set to invalid
  • Status changed from new to closed

I cannot reproduce it using 4.0-alpha, 3.9.1 or 3.9.

Maybe it's a plugin/theme problem and you need some support.

#2 @niente0
11 years ago

Hello, thanks for your quick response.
I have no plugins installed and I tried different themes on different machines.
I suspect it's something related with some char-related settings in PHP.INI (I'm using UTF8 general-ci in WP, PHP and MySQL db)...

#3 follow-up: @bi0xid
11 years ago

Hello again. I have tested the problem again with your configuration with Spanish and base installation. Still without being able to reproduce the problem.

Do you mind if we move this conversation to Support forums? If we find that it has something to do with the WordPress code and not with your installation or the Italian one, we can come back to the trac at any time.

#4 in reply to: ↑ 3 @niente0
11 years ago

Replying to bi0xid:

Hello again. I have tested the problem again with your configuration with Spanish and base installation. Still without being able to reproduce the problem.

Do you mind if we move this conversation to Support forums? If we find that it has something to do with the WordPress code and not with your installation or the Italian one, we can come back to the trac at any time.

Yes, no problem for me :-)

FYI: I tried with a clean install of WP 3.9.1 on my local machine (default theme, no added plugins), the bug persists.

Last edited 11 years ago by niente0 (previous) (diff)

#5 @knutsp
11 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Version 3.9.1 deleted

I can actually confirm this using 3.9-alpha (trunk), but not in 3.9.1. Also

a

c

disappears when entered in text mode, then saved from visual mode. It seems only to happen when there are at least three lines, and the second line ends with à.

Should be investigated.

Last edited 11 years ago by knutsp (previous) (diff)

#6 @knutsp
11 years ago

It happens when there are any number of lines, as long as there is a line after the line ending with à.

So the sequence à<newline><anychar> is what destroys something, after swtching to visual. So

à
b

also fails. I cannot reproduce using other accented characters, but I have not tested all yet.

#7 @knutsp
11 years ago

  • Component changed from Editor to TinyMCE

Worth noting that the text does get saved, and previewing the draft reveals this, even if the à doesn't print properly (question mark) . It certainly disappears from the visual editor view and when saved again, it's completely gone.

#8 @knutsp
11 years ago

  • Keywords dev-feedback added
  • Summary changed from This particular text disappears when saving a draft to All text disappears fornm view when one line ends with a-grave, then saving a draft from visual editor

Tested on:
WordPress 4.0-alpha with Twenty Fourteen, no plugins active, blog charset UTF-8
PHP 5.4.21, Mysql 5.5.27, IIS/7.0

#9 @SergeyBiryukov
11 years ago

  • Summary changed from All text disappears fornm view when one line ends with a-grave, then saving a draft from visual editor to All text disappears from view when one line ends with a-grave, then saving a draft from visual editor

#10 @azaozz
11 years ago

Testing in FF, Chrome and IE11 in trunk, not able to reproduce. Could you add some more info: which browser, locale settings, browser charset perhaps, anything else?

...even if the à doesn't print properly (question mark)

So something is "eating" part of that multibyte UTF char. Sounds like this may be related to how PCRE handles \s with different server locales, see https://core.trac.wordpress.org/ticket/22692#comment:58 and the discussion there. But then this should happen regardless of which editor was used and in all versions of WP.

Last edited 11 years ago by azaozz (previous) (diff)

#11 @azaozz
11 years ago

Looking further, pretty sure this is the same PHP/PCRE problem as described in #22692. The hex for that letter is 0xC3 0xA0 (ref: http://www.fileformat.info/info/unicode/char/e0/index.htm), so \s would match/strip 0xA0 in some cases. That only happens when it is the last letter on the row and there is more content after, most likely in wpautop().

Last edited 11 years ago by azaozz (previous) (diff)

#12 @knutsp
11 years ago

which browser, locale settings, browser charset perhaps, anything else?

Tested with Firefox 29, IE9 and Chrome 34, all with nb_NO language setting. Server has PCRE library 8.32. WordPress has UTF-8 and nb_NO.

#13 @iseulde
10 years ago

  • Component changed from TinyMCE to Formatting

#14 @miqrogroove
10 years ago

  • Keywords wpautop added
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from reopened to closed

Duplicate of #27733.

Let's focus on the existing ticket and just reference the a-grave for testing. I have recently started getting my toes wet with autop and should have some ideas ready for 4.3 or 4.4.

Note: See TracTickets for help on using tickets.