mirror of
https://github.com/takitsuba/obsidian-auto-bullet.git
synced 2026-07-22 05:42:45 +00:00
Add support for ignoring horizontal rules when adding bullet points
This commit is contained in:
parent
8526811bcd
commit
2846556070
1 changed files with 8 additions and 0 deletions
8
main.ts
8
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) ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue