The discussion revolves around a feature request to improve how nested quotes are handled in Discourse. ryanerwin describes a scenario where a user quotes a post that itself contains a quote, leading to confusion about authorship. The issue is that quotes are not validated, allowing users to quote any text as if it were from a specific post, potentially misattributing content. zogstrip notes the difficulty of resolving this due to the flexibility of quoting. david explains that while quotes are partially validated (with a .quote-modified class), they don’t always preserve the original source. ryanerwin emphasizes that this is a usability issue for less sophisticated users, as nested quotes can be confusing and lead to misattribution. codinghorror suggests the fix should be pursued if not too complex. Mittineague mentions the technical challenge of parsing nested quotes, but codinghorror clarifies that only the nearest quote header needs to be tracked. eviltrout assigns the task to nbianca, who confirms the issue has been resolved, ensuring that quoting a quote now preserves the original post’s information. codinghorror confirms the fix works as expected.
We do validate the quotes (kinda), and attach a .quote-modified class to any which have been amended. Let’s see if it figures out the nested quotes:
Hmmm, no it doesn’t. I guess ‘technically’ that content is still part of @ryanerwin’s post. Quite tricky to resolve though. As @zogstrip already said the best way is to try and get your users to quote the original post.
They do quote correctly most of the time. For casual users, nested quotes can be pretty complicated… The “Quote whole post” button is very rarely used for us.
It’s just the real example that came up today, where an innocent but not extremely sophisticated user was just trying to make a quote, and the quote appeared as though it was from a different user…
That’s why I posted it here.
Mods can of course manually edit the post to fix it. And this can’t come up too terribly often. Just a thought to avoid an awkward situation that comes up occasionally
@eviltrout if it isn’t incredibly complex and/or painful to fix, I wouldn’t mind if someone could take this one.. however if it is very complex, then ditch it.
IIRC, the last time I looked into a similar problem (JavaScript matching nested tags in excerpts) I got stuck at needing look-behind regex. Then again, I wouldn’t be surprised if someone better at regex than I could figure out an acceptable solution.
This has been implemented and works as expected now. Quoting a quote will preserve the original post information. Try it out with one of the quotes above.