@github/paste-markdown
Advanced tools
Comparing version 1.4.2 to 1.4.3
@@ -393,2 +393,7 @@ function insertText(textarea, text) { | ||
return; | ||
const start = html.substring(0, html.indexOf('<table')); | ||
const tableCloseIndex = html.lastIndexOf('</table>'); | ||
if (!start || !tableCloseIndex) | ||
return; | ||
const end = html.substring(tableCloseIndex + 8); | ||
const parser = new DOMParser(); | ||
@@ -401,3 +406,5 @@ const parsedDocument = parser.parseFromString(html, 'text/html'); | ||
const formattedTable = tableMarkdown(table); | ||
return html.replace(/<meta.*?>/, '').replace(/<table[.\S\s]*<\/table>/, `\n${formattedTable}`); | ||
if (!formattedTable) | ||
return; | ||
return [start, formattedTable, end].join('').replace(/<meta.*?>/, ''); | ||
} | ||
@@ -404,0 +411,0 @@ |
@@ -399,2 +399,7 @@ (function (global, factory) { | ||
return; | ||
const start = html.substring(0, html.indexOf('<table')); | ||
const tableCloseIndex = html.lastIndexOf('</table>'); | ||
if (!start || !tableCloseIndex) | ||
return; | ||
const end = html.substring(tableCloseIndex + 8); | ||
const parser = new DOMParser(); | ||
@@ -407,3 +412,5 @@ const parsedDocument = parser.parseFromString(html, 'text/html'); | ||
const formattedTable = tableMarkdown(table); | ||
return html.replace(/<meta.*?>/, '').replace(/<table[.\S\s]*<\/table>/, `\n${formattedTable}`); | ||
if (!formattedTable) | ||
return; | ||
return [start, formattedTable, end].join('').replace(/<meta.*?>/, ''); | ||
} | ||
@@ -410,0 +417,0 @@ |
{ | ||
"name": "@github/paste-markdown", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "Paste spreadsheet cells as a Markdown table.", | ||
@@ -16,4 +16,3 @@ "repository": "github/paste-markdown", | ||
"test": "karma start karma.config.js", | ||
"prepublishOnly": "npm run build", | ||
"postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'" | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -20,0 +19,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39703
938