Skip tab delimited lists in plain text to table conversion

This commit is contained in:
Vinoth Kannan 2017-12-26 15:52:22 +05:30
parent f6dc992b0f
commit 688f39447c
1 changed files with 2 additions and 1 deletions

View File

@ -633,7 +633,8 @@ export default Ember.Component.extend({
if (rows.length > 1) { if (rows.length > 1) {
const columns = rows.map(r => r.split("\t").length); const columns = rows.map(r => r.split("\t").length);
const isTable = columns.reduce((a, b) => a && columns[0] === b && b > 1); const isTable = columns.reduce((a, b) => a && columns[0] === b && b > 1) &&
!(columns[0] === 2 && rows[0].split("\t")[0].match(/^•$|^\d+.$/)); // to skip tab delimited lists
if (isTable) { if (isTable) {
const splitterRow = [...Array(columns[0])].map(() => "---").join("\t"); const splitterRow = [...Array(columns[0])].map(() => "---").join("\t");