Discourse is inserting a space between later-quoted italicized words and punctuation

I’ve noticed that, when I mention a book like The Great Gatsby or a movie like Breaker Morant, and when I or anyone else later quotes that passage, the system inserts a space after the last italicized word and any punctuation immediately after it.

Whyfor do it do dat?

Original version, the extra space shows in the quote.

I can remove that space without a problem though.

Hmm indeed. It didn’t just now, in this thread, but it did in the Botticelli thread just a few minutes ago.

See my final post above. It happens here. It can be removed.

Of course it can be removed. I would rather it didn’t have to be.

Does it also happen with bold text and any other formatted text? Could be something to do with copying and pasting.

ETA one can argue that punctuation immediately following italicized text should also be italicized. That may also avoid some copy/paste issues and italic correction weirdness.

Well, let me do a test.

I really like The Great Gatsby.
DPRK is a helluva Doper
When I last read The Great Gatsby, it was for my book club.
If I ever meet DPRK, I will buy that Doper a beer.

It did not put a space in after the book title or bold-faced text in any of these four examples.

ETA: I specifically quoted my previous post, but since it was immediately after that post, it did not show a quote box.

Still no space inserted. It is a puzzlement.

See posts 29 and 30 here, in the references to The Sting 2. The quote of my post introduced a space between the movie title and the question mark: Botticelli -- Aug 2020

And see posts 93 and 100 here, in the references to Bad Times at the El Royale. Happened again: Perry Mason on HBO

I selected your formatted text with the mouse and hit the grey Quote button to stick it in this reply. As you can see, spaces now appear where there were none before. I got identical results using Copy and Paste. I’m calling this definitely buggy behaviour, because the text was already rendered a certain way, so why should it change when it’s copied?

Seems doubly flaky if it inconsistently failed to put in spaces when you quoted your own post.

A wild guess is that the funny business happens when text on your screen that you select and paste is run by Discourse through an HTML parser.

Test: here is a sentence copied/pasted from Wikipedia:

Various events in Fitzgerald’s youth are reflected throughout The Great Gatsby .

Note the space that wasn’t there originally. I’ll leave it up to you all to file the bug report… :slight_smile:

foobar -> foo bar so it’s not just before punctuation.

I might be the code used to format the highlights is inserting the space as a coding trick to simplify parsing and then forgetting to remove it. I’ve seen that happen in a variety of environments over the years.