リンクをコピーするとクリック数が含まれる

たまに、URL にクリック数(例えば9回)が追記されたテキストが混入することがあります。

\u003eLorem ipsum dolor sit amet https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc onsetetur sadipscing elitr.

誰かがそのテキストをコピーして別の投稿に貼り付けると、末尾の「9」に気づかないことがあります。その結果、一見有効に見えるが実際には壊れたリンクが生成されてしまいます。

\u003e Lorem ipsum dolor sit amet https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc9 onsetetur sadipscing elitr.

これは、常に稼働中の Google ドキュメントへのリンクを含むコミュニティのお知らせを、複数の人が交代で執筆していることが原因です。BさんがAさんの前回のお知らせをコピーすると、あちこちに壊れたリンクが生まれてしまいます。クリック数の前にスペースを追加することはできないでしょうか。

「いいね!」 11

I believe that’d be a markup issue @awesomerobot I do like the suggestion if we can do it easily, have seen this before.

「いいね!」 3

It’s possible we could have a space here inserted, but even copying the number is superfluous imo, it should be in <span class='ignore-copy'> or something like that and we should get it into the clipboard without the number.

Also @yanokwa do you have enable rich text paste enabled, does this resolve your issue?

@vinothkannans we got to spend some time improving internal usage of enable rich text paste, it is a bit flakey.

「いいね!」 3

There’s a way to do prevent copying using psuedo elements, but it’s not great for accessibility (“CSS generated content is not content”)

Adding a space is a small improvement that shouldn’t impact anything else though.

「いいね!」 8

This is always :musical_note: to my :ear:s

「いいね!」 4

I do not rich text paste enabled and when I tried, it did not resolve the issue.

PR to add a space before the counter here:

「いいね!」 11

Space is added, so now you can copy & paste without breaking the link… like so:

https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc 2

Still room for future improvement, like not allowing click counts into the clipboard at all.

「いいね!」 7

Confirmed looks good, results in:

dolor sit amet https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc 2 onsetetur

Great idea @yanokwa

「いいね!」 1