sheet-happens 0.0.54 → 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 CHANGED
@@ -2176,6 +2176,7 @@ function _catch(body, recover) {
2176
2176
  return result;
2177
2177
  }
2178
2178
 
2179
+ var NON_BREAKING_SPACE = ' ';
2179
2180
  var EMPTY_TABLE = {
2180
2181
  rows: []
2181
2182
  };
@@ -2448,7 +2449,9 @@ var formatRowsAsTSV = function formatRowsAsTSV(rows) {
2448
2449
  var formatRowsAsHTML = function formatRowsAsHTML(rows, payload) {
2449
2450
  var trs = rows.map(function (row) {
2450
2451
  var tds = row.map(formatTextAsHTML).map(function (cell) {
2451
- return "<td>" + cell + "</td>";
2452
+ return "<td>" + cell.replaceAll(/ +/g, function (x) {
2453
+ return ' ' + NON_BREAKING_SPACE.repeat(x.length - 1);
2454
+ }) + "</td>";
2452
2455
  });
2453
2456
  return tds.join('');
2454
2457
  }).map(function (row) {
@@ -2548,7 +2551,7 @@ var parsePastedHtml = function parsePastedHtml(html) {
2548
2551
  str = td.textContent.trim();
2549
2552
  }
2550
2553
  str = str.replaceAll(/[\r\n\t ]+/g, ' ');
2551
- str = str.replaceAll(' ', ' ');
2554
+ str = str.replaceAll(NON_BREAKING_SPACE, ' ');
2552
2555
  row.push(str);
2553
2556
  }
2554
2557
  }