Why clipboard.reanHTML can't read the whole HTML


#1

When i copy some cell in Excel, it put a html to clipboard. But when i use readHTML to read it, it only return a part of the html not whole html


#2

Mind posting examples? Does it always cut off at a specific point?


#3

This is example ,when i copy this from excel 2016

Excel will set this Html in clipboard

<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 http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
href="file:///C:/Users/yougu/AppData/Local/Temp/msohtmlclip1/01/clip.htm">
<link rel=File-List
href="file:///C:/Users/yougu/AppData/Local/Temp/msohtmlclip1/01/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;}
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:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:等线;
	mso-generic-font-family:auto;
	mso-font-charset:134;
	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;}
.xl65
	{background:yellow;
	mso-pattern:black none;}
ruby
	{ruby-align:left;}
rt
	{color:windowtext;
	font-size:9.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:等线;
	mso-generic-font-family:auto;
	mso-font-charset:134;
	mso-char-type:none;
	display:none;}
-->
</style>
</head>

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

<table border=0 cellpadding=0 cellspacing=0 width=72 style='border-collapse:
 collapse;width:54pt'>
 <col width=72 style='width:54pt'>
 <tr height=19 style='height:14.25pt'>
<!--StartFragment-->
  <td height=19 class=xl65 align=right width=72 style='height:14.25pt;
  width:54pt'>123</td>
<!--EndFragment-->
 </tr>
</table>

</body>

</html>

but when i use clipboard.readHTML to read it, I can only get this:

<td height=19 class=xl65 align=right width=72 style='height:14.25pt;
  width:54pt'>123</td>

#4

How are you logging the HTML you get from the clipboard?

What happens if you use readText rather than readHTML?


#5

I use HTML5 paste event to get this html on chrome.
readText return an empty string.