Skip to content

Commit fd9c311

Browse files
authored
Merge pull request #1399 from pjkaufman/master
Fix List Marker Regex to Include Space After Markers
2 parents e1e6b68 + 9366479 commit fd9c311

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

__tests__/paragraph-blank-lines.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,5 +565,23 @@ ruleTest({
565565
\t\tbb
566566
`,
567567
},
568+
{ // accounts for https://github.com/platers/obsidian-linter/issues/1395
569+
testName: 'A paragraph starting with an asterisk for either italics or bold should have a blank line added',
570+
before: dedent`
571+
# Header
572+
**emphasis** blah blah...
573+
*italics* more content here...
574+
abcabc
575+
`,
576+
after: dedent`
577+
# Header
578+
${''}
579+
**emphasis** blah blah...
580+
${''}
581+
*italics* more content here...
582+
${''}
583+
abcabc
584+
`,
585+
},
568586
],
569587
});

src/utils/regex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const checklistBoxStartsTextRegex = new RegExp(`^${checklistBoxIndicator}
4747
export const indentedOrBlockquoteNestedChecklistIndicatorRegex = new RegExp(`^${lineStartingWithWhitespaceOrBlockquoteTemplate}- ${checklistBoxIndicator} `);
4848
export const nonBlockquoteChecklistRegex = new RegExp(`^\\s*- ${checklistBoxIndicator} `);
4949

50-
export const startsWithListMarkerRegex = new RegExp(`^\\s*(-|\\*|\\+|\\d+[.)]|- (${checklistBoxIndicator}))`, 'm');
50+
export const startsWithListMarkerRegex = new RegExp(`^\\s*(- |\\* |\\+ |\\d+[.)] |- (${checklistBoxIndicator}) )`, 'm');
5151

5252
export const footnoteDefinitionIndicatorAtStartOfLine = /^(\[\^[^\]]*\]) ?([,.;!:?])/gm;
5353
export const calloutRegex = /^(>\s*)+\[![^\s]*\]/m;

0 commit comments

Comments
 (0)