@lobehub/editor 4.29.0 → 4.29.1

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/es/headless.js CHANGED
@@ -3527,7 +3527,7 @@ var LitexmlDataSource = class extends DataSource {
3527
3527
  * Escape XML special characters
3528
3528
  */
3529
3529
  escapeXML(text) {
3530
- return text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;");
3530
+ return text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;").replaceAll(" ", "&#9;").replaceAll("\n", "&#10;").replaceAll("\r", "&#13;");
3531
3531
  }
3532
3532
  };
3533
3533
  //#endregion
@@ -10347,14 +10347,14 @@ const MathPlugin = class extends KernelPlugin {
10347
10347
  if (!litexmlService) return;
10348
10348
  litexmlService.registerXMLWriter(MathInlineNode.getType(), (node, ctx) => {
10349
10349
  if (node instanceof MathInlineNode) {
10350
- const attributes = { code: node.getTextContent() };
10350
+ const attributes = { code: node.code };
10351
10351
  return ctx.createXmlNode("math", attributes);
10352
10352
  }
10353
10353
  return false;
10354
10354
  });
10355
10355
  litexmlService.registerXMLWriter(MathBlockNode.getType(), (node, ctx) => {
10356
10356
  if (node instanceof MathBlockNode) {
10357
- const attributes = { code: node.getTextContent() };
10357
+ const attributes = { code: node.code };
10358
10358
  return ctx.createXmlNode("mathBlock", attributes);
10359
10359
  }
10360
10360
  return false;
@@ -281,7 +281,7 @@ var LitexmlDataSource = class extends DataSource {
281
281
  * Escape XML special characters
282
282
  */
283
283
  escapeXML(text) {
284
- return text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;");
284
+ return text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;").replaceAll(" ", "&#9;").replaceAll("\n", "&#10;").replaceAll("\r", "&#13;");
285
285
  }
286
286
  };
287
287
  //#endregion
@@ -39,14 +39,14 @@ const MathPlugin = class extends KernelPlugin {
39
39
  if (!litexmlService) return;
40
40
  litexmlService.registerXMLWriter(MathInlineNode.getType(), (node, ctx) => {
41
41
  if (node instanceof MathInlineNode) {
42
- const attributes = { code: node.getTextContent() };
42
+ const attributes = { code: node.code };
43
43
  return ctx.createXmlNode("math", attributes);
44
44
  }
45
45
  return false;
46
46
  });
47
47
  litexmlService.registerXMLWriter(MathBlockNode.getType(), (node, ctx) => {
48
48
  if (node instanceof MathBlockNode) {
49
- const attributes = { code: node.getTextContent() };
49
+ const attributes = { code: node.code };
50
50
  return ctx.createXmlNode("mathBlock", attributes);
51
51
  }
52
52
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/editor",
3
- "version": "4.29.0",
3
+ "version": "4.29.1",
4
4
  "description": "A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.",
5
5
  "keywords": [
6
6
  "lobehub",