From 284655607056b580ff66aa1fdd59ae0f064b038a Mon Sep 17 00:00:00 2001 From: Hiroo Takizawa Date: Sun, 23 Mar 2025 20:49:50 +0900 Subject: [PATCH] Add support for ignoring horizontal rules when adding bullet points --- main.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.ts b/main.ts index 0d89eeb..3207f22 100644 --- a/main.ts +++ b/main.ts @@ -200,6 +200,14 @@ export default class AutoBulletPlugin extends Plugin { return; } + // Check if the line is a horizontal rule (---, ***, ___) + const isHorizontalRule = /^\s*([-]{3,}|[*]{3,}|[_]{3,})\s*$/.test(line); + + // If the line is a horizontal rule, do not add bullet points + if (isHorizontalRule) { + return; + } + // Check if the last character typed was a space (half-width or full-width) or tab // and if the corresponding setting is enabled if ((lastChar === ' ' && this.settings.enableHalfWidthSpace) ||