@examind/block-sdk 0.1.24 → 0.1.25

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
@@ -1932,24 +1932,26 @@ var SpanNodeHandler = class extends NodeHandler2 {
1932
1932
  return this.createTextNode(node.text, styleAttr);
1933
1933
  }
1934
1934
  const results = [];
1935
- const textNodes = [];
1935
+ let currentTextNodes = [];
1936
1936
  for (const childNode of node.childNodes) {
1937
- for (const child of traverse2(childNode)) {
1937
+ const processedNodes = traverse2(childNode);
1938
+ for (const child of processedNodes) {
1938
1939
  if (child.type === "text") {
1939
- const textNode = child;
1940
- textNodes.push(textNode);
1940
+ currentTextNodes.push(child);
1941
1941
  } else {
1942
+ if (currentTextNodes.length > 0) {
1943
+ results.push(
1944
+ this.mergeTextNodes(currentTextNodes, styleAttr)
1945
+ );
1946
+ currentTextNodes = [];
1947
+ }
1942
1948
  results.push(child);
1943
1949
  }
1944
1950
  }
1945
1951
  }
1946
- if (textNodes.length > 0) {
1947
- const mergedTextNode = this.mergeTextNodes(
1948
- textNodes,
1949
- styleAttr
1950
- );
1951
- results.push(mergedTextNode);
1952
- } else if (node.text.trim()) {
1952
+ if (currentTextNodes.length > 0) {
1953
+ results.push(this.mergeTextNodes(currentTextNodes, styleAttr));
1954
+ } else if (node.text.trim() && results.length === 0) {
1953
1955
  results.push(this.createTextNode(node.text, styleAttr));
1954
1956
  }
1955
1957
  return results;
package/dist/index.mjs CHANGED
@@ -1905,24 +1905,26 @@ var SpanNodeHandler = class extends NodeHandler2 {
1905
1905
  return this.createTextNode(node.text, styleAttr);
1906
1906
  }
1907
1907
  const results = [];
1908
- const textNodes = [];
1908
+ let currentTextNodes = [];
1909
1909
  for (const childNode of node.childNodes) {
1910
- for (const child of traverse2(childNode)) {
1910
+ const processedNodes = traverse2(childNode);
1911
+ for (const child of processedNodes) {
1911
1912
  if (child.type === "text") {
1912
- const textNode = child;
1913
- textNodes.push(textNode);
1913
+ currentTextNodes.push(child);
1914
1914
  } else {
1915
+ if (currentTextNodes.length > 0) {
1916
+ results.push(
1917
+ this.mergeTextNodes(currentTextNodes, styleAttr)
1918
+ );
1919
+ currentTextNodes = [];
1920
+ }
1915
1921
  results.push(child);
1916
1922
  }
1917
1923
  }
1918
1924
  }
1919
- if (textNodes.length > 0) {
1920
- const mergedTextNode = this.mergeTextNodes(
1921
- textNodes,
1922
- styleAttr
1923
- );
1924
- results.push(mergedTextNode);
1925
- } else if (node.text.trim()) {
1925
+ if (currentTextNodes.length > 0) {
1926
+ results.push(this.mergeTextNodes(currentTextNodes, styleAttr));
1927
+ } else if (node.text.trim() && results.length === 0) {
1926
1928
  results.push(this.createTextNode(node.text, styleAttr));
1927
1929
  }
1928
1930
  return results;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@examind/block-sdk",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "@comment version": [
5
5
  "Don't specify package version here. It will be injected by publish workflow."
6
6
  ],
@@ -21,7 +21,7 @@
21
21
  "peerDependencies": {
22
22
  "nanoid": ">=3.0.0",
23
23
  "node-html-parser": ">=6.0.0",
24
- "@examind/block-types": "^0.1.24"
24
+ "@examind/block-types": "^0.1.25"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@eslint/js": "^9.17.0",
@@ -36,7 +36,7 @@
36
36
  "tsup": "^8.3.5",
37
37
  "typescript": "^5.7.2",
38
38
  "typescript-eslint": "^8.18.2",
39
- "@examind/block-types": "0.1.24"
39
+ "@examind/block-types": "0.1.25"
40
40
  },
41
41
  "dependencies": {
42
42
  "lodash-es": "4.17.21"