Copied table from Excel is pasted as raw HTML

Open
#82 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
frontend

Research direction

Start by reproducing the Excel-table paste in Chrome and Safari on the web UI, using the attached example_table.xlsx and the provided steps. Trace the browser clipboard and paste handling implicated by the issue. Done means Chrome produces the same Markdown-style table as Safari instead of exposing the raw Excel HTML.

Written by the indexing model from the issue text.

Description

To Reproduce

Steps to reproduce the behavior:

  1. Copy table from example_table.xlsx
image
  1. Open Google Chrome and navigated to Web UI on GHES 3.8 instance (This issue is reproduced in GitHub.com as well)

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

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
href="file:////Users/hikanema/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip.htm">
<link rel=File-List
href="file:////Users/hikanema/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip_filelist.xml">
<style>
<!--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;}
-->
</style>
</head>

<body link="#0563C1" vlink="#954F72">



a | b
-- | --
1 | 2



</body>

</html>

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

Markdown in Safari
image

Dominant language
JavaScript
Stars
234
Forks
47
Avg merge
1d 12h
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/paste-markdown

All issues in github/paste-markdown

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.