github / github/paste-markdown

Copied table from Excel is pasted as raw HTML

未關閉
#82 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
234
分支
47
平均合併
1 天 12 小時
30 天內合併 PR
5

描述

### To Reproduce

Steps to reproduce the behavior:
1. Copy table from [example_table.xlsx](https://github.com/github/issues/files/11222266/example_table.xlsx)
image

2. Open Google Chrome and navigated to Web UI on GHES 3.8 instance (This issue is reproduced in GitHub.com as well)

3. Paste it on a issue comment. It is pasted as raw HTML.
```

<!--table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
@page
{margin:.75in .7in .75in .7in;
mso-header-margin:.3in;
mso-footer-margin:.3in;}
.font5
{color:windowtext;
font-size:6.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:游ゴシック;
mso-generic-font-family:auto;
mso-font-charset:128;}
tr
{mso-height-source:auto;
mso-ruby-visibility:none;}
col
{mso-width-source:auto;
mso-ruby-visibility:none;}
br
{mso-data-placement:same-cell;}
td
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:游ゴシック;
mso-generic-font-family:auto;
mso-font-charset:128;
mso-number-format:General;
text-align:general;
vertical-align:middle;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate:0;}
ruby
{ruby-align:left;}
rt
{color:windowtext;
font-size:6.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:游ゴシック;
mso-generic-font-family:auto;
mso-font-charset:128;
mso-char-type:katakana;
display:none;}
-->

a | b
-- | --
1 | 2

```

**Expected behavior**
When I pasted the same excel table in Safari, it was formatted as Markdown style.

```
a | b
-- | --
1 | 2
```

**Screenshots**
Copy and paste table from Excel results in both raw HTML and Markdown. It depends on browser

Raw HTML in Chrome
![image](https://github.com/github/issues/assets/103219888/5948d3c9-6f73-4565-aa4b-06ad3d8298f0)

Markdown in Safari
image

貢獻指南

開啟貢獻指南

研究方向

首先,按照提供的步驟,使用附件 example_table.xlsx 在 web UI 中的 Chrome 和 Safari 裡重現貼上 Excel 表格的操作。追蹤此問題涉及的瀏覽器剪貼簿與貼上處理流程。當 Chrome 產生與 Safari 相同的 Markdown 風格表格,而不是暴露原始 Excel HTML 時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
frontend
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。