Page MenuHomePhabricator

"Reply" links are copied in 2017 wikitext editor and DiscussionTools
Open, LowPublic

Description

Reproduce:

Expected:
The content pasted are:

aaa --GZWDer (talk) 17:12, 1 February 2025 (UTC)
bbb --GZWDer (talk) 17:12, 1 February 2025 (UTC)
ccc --GZWDer (talk) 17:12, 1 February 2025 (UTC)

Actual:

The content pasted are:

aaa --GZWDer (talk) 17:12, 1 February 2025 (UTC)Reply
bbb --GZWDer (talk) 17:12, 1 February 2025 (UTC)Reply
ccc --GZWDer (talk) 17:12, 1 February 2025 (UTC)Reply

Event Timeline

Esanders subscribed.

Chrome and Firefox disagree about th effects of user-select: none: https://stackoverflow.com/questions/16989387/user-select-still-copies-to-clipboard

Chrome copies such content to the clipboard, whereas Firefox doesn't.

With visual enhancements enabled (e.g. https://www.mediawiki.org/w/index.php?title=Project:Sandbox&oldid=6995943&dtenable=1), the reply link becomes an OOUI button. Because the is a link-wrapped span, it becomes an inline-alien when pasted into VE and therefore deleted, so this is only a problem when visual enhancements aren't enabled.

Here a few ways we could fix this and make it more robust when visual enhancements are enabled:

  1. Add a data-ve-ignore attribute to reply buttons, so they never get pasted in VE.
  2. Have the VE paste handler ignore class=ext-discussiontools-init-replybutton
  3. Render all the text contents of reply links/buttons with CSS content, which is not copied to the clipboard.

3 would be the best fix as it stops the contents going into the clipboard in the first place.

Note this is also an issue with [ edit ] section links in article mode.