Discourseはタブ区切りリストのコピー&ペーストを自動的にテーブルに変換します

ページからドラッグ選択してテキストをコピーすると、以下のようになります。

しかし、「コピー」ボタンを使用してコピーすると、貼り付け時に期待どおりのテキストのみを取得できます。

「コピー」ボタンを使用したクリップボードの内容:

TEXT:
b'```sh\\n\\tsystemctl reboot\\n\\t```'
text/plain:
b'```sh\\n\\tsystemctl reboot\\n\\t```'

ページ上でドラッグ選択したことによるクリップボードの内容:

TEXT:
b'\\t```sh\\n\\tsystemctl reboot\\n\\t```'
text/html:
b'<span style="color: rgb(199, 199, 199); font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace; font-size: 17.008px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(60, 60, 60); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">\\t```sh\\n\\tsystemctl reboot\\n\\t```</span>'
text/plain:
b'\\t```sh\\n\\tsystemctl reboot\\n\\t```'

おそらく、各行の先頭にあるタブストップが問題を混乱させているのでしょう。クリップボードの内容を解析する際に、最初の列が常に空であれば、リストとして扱わないようにするのかもしれません。

これは少し異常な状況のように思えますが、自然な状況で発生することはありますか?通常、投稿にタブストップ文字が含まれることはありません。

rokejulianlockhart, post:1, topic:266325
これは明らかにリストであり、テーブルではありません

コンピュータにとっては、最初の列が空のタブ区切りテーブルとまったく同じように見えます。

「いいね!」 7