Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@github/paste-markdown

Package Overview
Dependencies
Maintainers
16
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@github/paste-markdown - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

18

dist/index.esm.js

@@ -153,13 +153,17 @@ function insertText(textarea, text) {

return;
const html = transfer.getData('text/html');
let html = transfer.getData('text/html');
if (!/<table/i.test(html))
return;
html = html.replace(/<meta.*?>/, '');
const el = document.createElement('div');
el.innerHTML = html;
let table = el.querySelector('table');
table = !table || table.closest('[data-paste-markdown-skip]') ? null : table;
if (!table)
return;
const formattedTable = tableMarkdown(table);
return html.replace(/<meta.*?>/, '').replace(/<table[.\S\s]*<\/table>/, `\n${formattedTable}`);
const tables = el.querySelectorAll('table');
for (const table of tables) {
if (table.closest('[data-paste-markdown-skip]')) {
table.replaceWith(new Text(table.textContent || ''));
}
const formattedTable = tableMarkdown(table);
table.replaceWith(new Text(formattedTable));
}
return el.innerHTML;
}

@@ -166,0 +170,0 @@

@@ -159,13 +159,17 @@ (function (global, factory) {

return;
const html = transfer.getData('text/html');
let html = transfer.getData('text/html');
if (!/<table/i.test(html))
return;
html = html.replace(/<meta.*?>/, '');
const el = document.createElement('div');
el.innerHTML = html;
let table = el.querySelector('table');
table = !table || table.closest('[data-paste-markdown-skip]') ? null : table;
if (!table)
return;
const formattedTable = tableMarkdown(table);
return html.replace(/<meta.*?>/, '').replace(/<table[.\S\s]*<\/table>/, `\n${formattedTable}`);
const tables = el.querySelectorAll('table');
for (const table of tables) {
if (table.closest('[data-paste-markdown-skip]')) {
table.replaceWith(new Text(table.textContent || ''));
}
const formattedTable = tableMarkdown(table);
table.replaceWith(new Text(formattedTable));
}
return el.innerHTML;
}

@@ -172,0 +176,0 @@

{
"name": "@github/paste-markdown",
"version": "0.3.1",
"version": "0.3.2",
"description": "Paste spreadsheet cells as a Markdown table.",

@@ -5,0 +5,0 @@ "repository": "github/paste-markdown",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc