Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#24159 closed defect (bug) (invalid)

Chats with spaces in the 'speaker' not parsing correctly

Reported by: Ipstenu Owned by:
Milestone: Priority: normal
Severity: major Version: 3.6
Component: Post Formats Keywords: has-patch
Focuses: Cc:


Since #23625 is closed and we were asked to make a new ticket, the issue I mentioned still remains.

Related to #23947 - currently this is broken in instances where chat names have spaces.


That has the post content as follows:

Nigel Tufnel: The numbers all go to eleven. Look, right across the board, eleven, eleven, eleven and…

Marti DiBergi: Oh, I see. And most amps go up to ten?

Nigel Tufnel: Exactly.

Marti DiBergi: Does that mean it’s louder? Is it any louder?

Nigel Tufnel: Well, it’s one louder, isn’t it? It’s not ten. You see, most blokes, you know, will be playing at ten. You’re on ten here, all the way up, all the way up, all the way up, you’re on ten on your guitar. Where can you go from there? Where?

Marti DiBergi: I don’t know.

Nigel Tufnel: Nowhere. Exactly. What we do is, if we need that extra push over the cliff, you know what we do?

Marti DiBergi: Put it up to eleven.

Nigel Tufnel: Eleven. Exactly. One louder.

Marti DiBergi: Why don’t you just make ten louder and make ten be the top number and make that a little louder?

Nigel Tufnel: These go to eleven.

But nothing shows.

You can see the exact same issue here: http://twentythirteendemo.wordpress.com/2013/02/10/never-say-never-say-never/

James Bond's lines are never shown.

Attachments (2)

24159.diff (2.5 KB) - added by belloswan 5 years ago.
24159.2.diff (611 bytes) - added by aaroncampbell 5 years ago.

Download all attachments as: .zip

Change History (15)

#1 @wonderboymusic
5 years ago

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

I will check the Unit Tests and make sure the expected output is correct, then make sure the theme is parsing properly

#2 @belloswan
5 years ago

  • Cc antoine@… added
  • Keywords needs-testing added

This patch fixs this bug but doesn't allow the chat be presented like this : Username: [Line-break] Message [Line-break] Username: [Line-break] Message

It has to be like this: Username: Message Username: Message

5 years ago

#3 @wonderboymusic
5 years ago

Did you run Unit Tests against this? I have a feeling this is going to be no bueno

#4 @belloswan
5 years ago

Yes it does work but the Unit Tests chat post is really simple...

#5 @wonderboymusic
5 years ago

  • Keywords has-patch needs-unit-tests added; needs-patch removed

Cool - could you add some more Unit Tests related to this ticket?

#6 @lancewillett
5 years ago

See also #24240 for a similar case with Quote formats.

#7 @aaroncampbell
5 years ago

Ipstenu: Where did that chat get copied from? The chat system has different parsers for IM and Skype, and I'm wondering which should be handling this.

#8 @aaroncampbell
5 years ago

First, 24159.2.diff fixes this particular use case. However, it only fixes it because there's an empty line between each stanza. Without that, chats with spaces in the usernames will still break.

The core issue seems to be that what we're trying to handle this scenario:

Scott: Hey.
I have a question: what is your favorite color?
Nacin: Go away.

The problem is that while I see what we're trying to do, in almost every chat program "I have a question" is a valid username. I think we're trying to be too smart here.

Maybe we could check for spaces or tabs only at the beginning of the username? Then we could support these without compromising spaces in usernames:

Scott: Hey.
  I have a question: what is your favorite color?
Nacin: Go away.
Scott: Hey.
	I have a question: what is your favorite color?
Nacin: Go away.

#9 @ryan
5 years ago

I'd be okay with being less smart, and thus more reliable.

Version 0, edited 5 years ago by ryan (next)

#10 @Ipstenu
5 years ago

The sample text came from the TwentyThirteen demo site.

Keep in mind, chats aren't just "I'm copying this straight from IM" but also used today as a way to transcribe interviews and radio events etc. With that in mind, there should be a fall back to handle spaces in names, if Skype etc aren't 'detected'

#11 @wonderboymusic
5 years ago

  • Milestone 3.6 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Chat code was thrown in the trash can (editor's note: ..... )

#13 @SergeyBiryukov
5 years ago

  • Keywords needs-testing needs-unit-tests removed
Note: See TracTickets for help on using tickets.