Skip to content
Parser for pasted data that is copied from spreadsheet on Excel and Google Drive
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
sample
test
.gitignore
.travis.yml
LICENSE
README.md
bower.json
demo.gif
gruntfile.js
package.json

README.md

expaste

Parser for pasted data that is copied from spreadsheet on Excel and Google Drive

npm version Bower version Build Status Dependency Status devDependency Status

demo

ex.) Markdown output

Demo Page

demo

usage

Vanilla

document.getElementById('input').addEventListener('paste', function (e) {

	var ep = expaste.getDataByEvent(e);

	// output style
	var json = ep.toJSONStringify();
	var csv = ep.toCSV();
	var tsv = ep.toTSV();
	var md = ep.toMarkdown();

	// overwritten paste
	this.value = md;

	e.preventDefault();

}, false);

jQuery

$('#input').on('paste', function (e) {

	var ep = expaste.getDataByEvent(e.originalEvent);

	// output style
	var json = ep.toJSONStringify();
	var csv = ep.toCSV();
	var tsv = ep.toTSV();
	var md = ep.toMarkdown();

	// overwritten paste
	$(this).val(md);

	return false;

});

Support

  • Chrome
  • Safari
  • Firefox

unsupport

  • Internet Explorer

Partial support in IE refers using a non-standard method of interacting with the clipboard. Can I use

You can’t perform that action at this time.