从页面上拖动选择文本进行复制时,我会得到:
但是使用复制按钮复制时:
粘贴后我能正确地只得到预期的文本。
使用“复制”按钮时的剪贴板内容是:
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, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", 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```'
这可能是每行开头的制表符在混淆视听——也许在解析剪贴板内容时,如果第一列总是为空,我们就不将其视为列表。
这似乎是一个非常特殊的情况——有没有可能自然出现这种情况?通常帖子中不会有制表符。
对于计算机来说,它看起来完全像一个带有空白第一列的制表符分隔的表格。

