Smart quotes breaking Quote template

On at least two different Discourse sites I’ve run into a problem where when I select text and hit “Quote” to reply, smart quotes get used in one place which breaks the appearance of my post. Here is a screenshot of an example post that is displaying incorrectly because of the smart quote at the end of the first line (inside the brackets):

This has been happening for months, and I only just figured out what was going on with those posts.

I can reproduce it about 50% of the time on Safari 18.4 on Mac OS 15.4 as well as an earlier version of Safari on Mac OS 15.3.

The site I run where I see it is running Discourse 3.4.2. Another site I just ran into it on is running 3.4.0.beta3-dev.

I believe I have also seen some other people running into this issue on my site, but I haven’t double checked that today.

1 Like

Obviously a true fix should be made for a bug, but in case it will be useful in the meantime I’ll mention that a workaround might be to remove double quotes from the Markdown typographer quotation marks site setting, or disable the Enable markdown typographer site setting.

I am assuming that it is this “Markdown typographer” feature that is causing the replacement of the correct straight double quote character in the BBCode tag with the incorrect “smart” or “curly quote” character.

Its a good hunch, but I remember a similar issue from years ago and recall we even carry some code in Discourse that converts “→ " to handle this edge case.

@jtbayly do these sites have the new composer enabled?

Neither has the new compose enabled.

Another user reports if I turn off Smart Quote substitutions in Safari’s Edit->Substitutions->Smart Quotes, that will fix it.

I don’t particularly want to do that though. lol. I like my smart quotes most of the time.

I think this is the issue, in addition to the fact we imitate user input on the textarea on this type of addition to avoid losing the undo history.

I believe it can be “solved” with a spellcheck="false" on the element, but it has an obvious downside.

What’s causing the issue is the inconsistent quotation, it would work if it had the same style of quotes on both ends – any of these sets can be used:

It’s weird that only the second quotation mark got converted when quoting though, both sides get converted if the same BBCode is typed manually.

1 Like

The problem is also inconsistent. It doesn’t happen every time, although I haven’t figured out when it happens and when it doesn’t.

It’s funny that it works with so many different quote options, but this one doesn’t work. I wonder…

Would it actually be a simple fix and not cause problems to match inconsistent quotation mark styles? " and ” in particular?