![貼上在 Word for Mac 2011 中](https://rvso.com/image/1576389/%E8%B2%BC%E4%B8%8A%E5%9C%A8%20Word%20for%20Mac%202011%20%E4%B8%AD.png)
如果我創建一個帶有簡單 <pre> 格式文字的 HTML 文檔
<body>
<p>This is a test
<ul>
<li>this is an item
<li>this is another
<li>this is the third
</ul>
<p>
<pre>
{ "firstName": "John",
"lastName": "Smith",
"age": 25 }
</pre>
</body>
在 Chrome 中開啟它,並將其貼到 MS Word 2011 中,它的 <pre> 中沒有換行符:
OTOH,如果我在 LibreOffice 中執行相同的粘貼,則 <pre> 會被保留。奇怪的是,如果我選擇只是<pre> 中的區域,並貼上為文本,換行符將被保留。
有誰知道無需手動重新格式化所有 <pre> 內容即可完成這項工作的技巧?