diff --git a/src/main/engine/ImportAnalysisEngine.ts b/src/main/engine/ImportAnalysisEngine.ts
index 6e0aa37..cbdd443 100644
--- a/src/main/engine/ImportAnalysisEngine.ts
+++ b/src/main/engine/ImportAnalysisEngine.ts
@@ -170,6 +170,30 @@ export class ImportAnalysisEngine {
codeBlockStyle: 'fenced',
bulletListMarker: '-',
});
+
+ // Custom rule for list items: use single space after marker instead of multiple spaces
+ this.turndown.addRule('listItem', {
+ filter: 'li',
+ replacement: (content, node, options) => {
+ content = content
+ .replace(/^\n+/, '') // Remove leading newlines
+ .replace(/\n+$/, '\n') // Replace trailing newlines with single newline
+ .replace(/\n/gm, '\n '); // Indent subsequent lines with 2 spaces
+
+ const parent = node.parentNode as HTMLElement;
+ const isOrdered = parent?.nodeName === 'OL';
+ let prefix = options.bulletListMarker + ' ';
+
+ if (isOrdered) {
+ const start = parent.getAttribute('start');
+ const index = Array.prototype.indexOf.call(parent.children, node);
+ const startNum = start ? parseInt(start, 10) : 1;
+ prefix = (startNum + index) + '. ';
+ }
+
+ return prefix + content + (node.nextSibling && !/\n$/.test(content) ? '\n' : '');
+ },
+ });
// Custom rule for linked images:
-> 
// This handles the common WordPress pattern of wrapping thumbnails in links to full-size images
diff --git a/src/main/engine/ImportExecutionEngine.ts b/src/main/engine/ImportExecutionEngine.ts
index bfdccc6..32cfdac 100644
--- a/src/main/engine/ImportExecutionEngine.ts
+++ b/src/main/engine/ImportExecutionEngine.ts
@@ -85,6 +85,30 @@ export class ImportExecutionEngine extends EventEmitter {
bulletListMarker: '-',
});
+ // Custom rule for list items: use single space after marker instead of multiple spaces
+ this.turndown.addRule('listItem', {
+ filter: 'li',
+ replacement: (content, node, options) => {
+ content = content
+ .replace(/^\n+/, '') // Remove leading newlines
+ .replace(/\n+$/, '\n') // Replace trailing newlines with single newline
+ .replace(/\n/gm, '\n '); // Indent subsequent lines with 2 spaces
+
+ const parent = node.parentNode as HTMLElement;
+ const isOrdered = parent?.nodeName === 'OL';
+ let prefix = options.bulletListMarker + ' ';
+
+ if (isOrdered) {
+ const start = parent.getAttribute('start');
+ const index = Array.prototype.indexOf.call(parent.children, node);
+ const startNum = start ? parseInt(start, 10) : 1;
+ prefix = (startNum + index) + '. ';
+ }
+
+ return prefix + content + (node.nextSibling && !/\n$/.test(content) ? '\n' : '');
+ },
+ });
+
// Custom rule for linked images:
-> 
// This handles the common WordPress pattern of wrapping thumbnails in links to full-size images
this.turndown.addRule('linkedImage', {