@scrider/formatter 1.10.7 → 1.10.8

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
@@ -4040,6 +4040,12 @@ function htmlToDelta(html, options = {}) {
4040
4040
  pendingText = "";
4041
4041
  }
4042
4042
  }
4043
+ function beginBlockEmbedLine() {
4044
+ flushText();
4045
+ if (!atLineStart) {
4046
+ context.pushNewline();
4047
+ }
4048
+ }
4043
4049
  function processNode(node) {
4044
4050
  if (node.nodeType === NODE_TYPE.TEXT_NODE) {
4045
4051
  const text = node.textContent ?? "";
@@ -4406,7 +4412,7 @@ function htmlToDelta(html, options = {}) {
4406
4412
  };
4407
4413
  const data = footnotesHandler.fromHtml(section, blockContext);
4408
4414
  if (data) {
4409
- flushText();
4415
+ beginBlockEmbedLine();
4410
4416
  delta.insert({ block: data });
4411
4417
  delta.insert("\n");
4412
4418
  atLineStart = true;
@@ -4428,7 +4434,7 @@ function htmlToDelta(html, options = {}) {
4428
4434
  };
4429
4435
  const data = alertHandler.fromHtml(element, blockContext);
4430
4436
  if (data) {
4431
- flushText();
4437
+ beginBlockEmbedLine();
4432
4438
  delta.insert({ block: data });
4433
4439
  delta.insert("\n");
4434
4440
  atLineStart = true;
@@ -4450,7 +4456,7 @@ function htmlToDelta(html, options = {}) {
4450
4456
  };
4451
4457
  const data = columnsHandler.fromHtml(element, blockContext);
4452
4458
  if (data) {
4453
- flushText();
4459
+ beginBlockEmbedLine();
4454
4460
  delta.insert({ block: data });
4455
4461
  delta.insert("\n");
4456
4462
  atLineStart = true;
@@ -4472,7 +4478,7 @@ function htmlToDelta(html, options = {}) {
4472
4478
  };
4473
4479
  const data = boxHandler.fromHtml(element, blockContext);
4474
4480
  if (data) {
4475
- flushText();
4481
+ beginBlockEmbedLine();
4476
4482
  const opAttrs = {};
4477
4483
  const dataFloat = element.getAttribute("data-float");
4478
4484
  if (dataFloat) opAttrs.float = dataFloat;
@@ -4521,7 +4527,7 @@ function htmlToDelta(html, options = {}) {
4521
4527
  let data = tableHandler.fromHtml(table, makeTableBlockParseContext());
4522
4528
  if (!data) return false;
4523
4529
  if (host) data = enrichTableBlockFromHost(data, host);
4524
- flushText();
4530
+ beginBlockEmbedLine();
4525
4531
  delta.insert({ block: data });
4526
4532
  delta.insert("\n");
4527
4533
  atLineStart = true;