@lobehub/editor 1.16.1 → 1.16.2

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.
@@ -82,6 +82,7 @@ export var CommonPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
82
82
  // Parse markdown options
83
83
  var markdownOption = (_this$config$markdown = (_this$config = this.config) === null || _this$config === void 0 ? void 0 : _this$config.markdownOption) !== null && _this$config$markdown !== void 0 ? _this$config$markdown : true;
84
84
  var isMarkdownEnabled = markdownOption !== false;
85
+ var softBreak = isMarkdownEnabled ? '\n\n' : '\n';
85
86
 
86
87
  // Determine which formats are enabled
87
88
  var formats = {
@@ -100,9 +101,6 @@ export var CommonPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
100
101
  formats.quote = (_markdownOption$quote = markdownOption.quote) !== null && _markdownOption$quote !== void 0 ? _markdownOption$quote : true;
101
102
  formats.strikethrough = (_markdownOption$strik = markdownOption.strikethrough) !== null && _markdownOption$strik !== void 0 ? _markdownOption$strik : true;
102
103
  }
103
- if (!isMarkdownEnabled) {
104
- return;
105
- }
106
104
 
107
105
  // Register quote shortcut if enabled
108
106
  if (formats.quote) {
@@ -191,11 +189,11 @@ export var CommonPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
191
189
  markdownService.registerMarkdownShortCuts(textFormatShortcuts);
192
190
  }
193
191
  markdownService.registerMarkdownWriter('paragraph', function (ctx) {
194
- ctx.wrap('', '\n\n');
192
+ ctx.wrap('', softBreak);
195
193
  });
196
194
  markdownService.registerMarkdownWriter('quote', function (ctx, node) {
197
195
  if ($isQuoteNode(node)) {
198
- ctx.wrap('> ', '\n\n');
196
+ ctx.wrap('> ', softBreak);
199
197
  }
200
198
  });
201
199
  markdownService.registerMarkdownWriter('heading', function (ctx, node) {
@@ -233,7 +231,7 @@ export var CommonPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
233
231
  }
234
232
  default:
235
233
  {
236
- ctx.wrap('', '\n\n');
234
+ ctx.wrap('', softBreak);
237
235
  break;
238
236
  }
239
237
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/editor",
3
- "version": "1.16.1",
3
+ "version": "1.16.2",
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",