🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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

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",