Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,21 @@ ruleTest({
${''}
`,
},
{
// accounts for https://github.com/platers/obsidian-linter/issues/1354
testName: 'Make sure that empty lines for list markers includes lines with just whitespace',
before: dedent`
- \`Collection<E>\` represents a group of **individual elements** (E, like a list of names).
${'\t'}
- \`Map<K, V>\` represents a collection of **key-value pairs** (e.g., a phonebook: name → number).
${' \t'}
${' '}- \`List<E>\` ...
`,
after: dedent`
- \`Collection<E>\` represents a group of **individual elements** (E, like a list of names).
- \`Map<K, V>\` represents a collection of **key-value pairs** (e.g., a phonebook: name → number).
${' '}- \`List<E>\` ...
`,
},
],
});
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class RemoveEmptyLinesBetweenListMarkersAndChecklists extends Rul
return this.replaceEmptyLinesBetweenList(text, splatMarkerRegexText);
}
replaceEmptyLinesBetweenList = function(text: string, listIndicatorRegexText: string): string {
const listRegex = new RegExp(`^${listIndicatorRegexText}\n{2,}${listIndicatorRegexText}$`, 'gm');
const listRegex = new RegExp(`^${listIndicatorRegexText}\n(?:(?:[\t\v\f\r \u00a0\u2000-\u200b\u2028-\u2029\u3000]+)?\n){1,}${listIndicatorRegexText}$`, 'gm');
let match;
let newText = text;

Expand Down