sheet-happens 0.0.53 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +6 -3
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -2173,6 +2173,7 @@ function _catch(body, recover) {
|
|
|
2173
2173
|
return result;
|
|
2174
2174
|
}
|
|
2175
2175
|
|
|
2176
|
+
var NON_BREAKING_SPACE = ' ';
|
|
2176
2177
|
var EMPTY_TABLE = {
|
|
2177
2178
|
rows: []
|
|
2178
2179
|
};
|
|
@@ -2445,7 +2446,9 @@ var formatRowsAsTSV = function formatRowsAsTSV(rows) {
|
|
|
2445
2446
|
var formatRowsAsHTML = function formatRowsAsHTML(rows, payload) {
|
|
2446
2447
|
var trs = rows.map(function (row) {
|
|
2447
2448
|
var tds = row.map(formatTextAsHTML).map(function (cell) {
|
|
2448
|
-
return "<td>" + cell
|
|
2449
|
+
return "<td>" + cell.replaceAll(/ +/g, function (x) {
|
|
2450
|
+
return ' ' + NON_BREAKING_SPACE.repeat(x.length - 1);
|
|
2451
|
+
}) + "</td>";
|
|
2449
2452
|
});
|
|
2450
2453
|
return tds.join('');
|
|
2451
2454
|
}).map(function (row) {
|
|
@@ -2544,8 +2547,8 @@ var parsePastedHtml = function parsePastedHtml(html) {
|
|
|
2544
2547
|
} else {
|
|
2545
2548
|
str = td.textContent.trim();
|
|
2546
2549
|
}
|
|
2547
|
-
str = str.replaceAll(
|
|
2548
|
-
str = str.replaceAll(
|
|
2550
|
+
str = str.replaceAll(/[\r\n\t ]+/g, ' ');
|
|
2551
|
+
str = str.replaceAll(NON_BREAKING_SPACE, ' ');
|
|
2549
2552
|
row.push(str);
|
|
2550
2553
|
}
|
|
2551
2554
|
}
|