mirror of
https://github.com/jglev/obsidian-apply-patterns-plugin.git
synced 2026-07-22 05:40:26 +00:00
Fixed bug whereby noncompliant patterns would not be filtered correctly, causing other patterns to be filtered in their place. (#59)
This commit is contained in:
parent
f444bac791
commit
0f5007cc72
4 changed files with 14 additions and 10 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "obsidian-apply-patterns",
|
||||
"name": "Apply Patterns",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.2",
|
||||
"minAppVersion": "0.14.5",
|
||||
"description": "Apply custom patterns of find-and-replace in succession to text.",
|
||||
"author": "Jacob Levernier",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "obsidian-apply-patterns",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.2",
|
||||
"description": "An Obsidian plugin for applying patterns of find and replace in succession.",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -10,15 +10,18 @@ import {
|
|||
|
||||
export const filterPatterns = (command?: Command): number[] => {
|
||||
const patterns = getSettings().patterns;
|
||||
|
||||
let patternIndexes: number[] = getSettings()
|
||||
.patterns.filter(
|
||||
(pattern: Pattern) =>
|
||||
pattern.rules.length > 0 &&
|
||||
pattern.rules.every((rule: PatternRule) => rule.from !== ''),
|
||||
.patterns
|
||||
.map((pattern: Pattern, patternIndex: number) => {
|
||||
return {pattern, patternIndex}
|
||||
})
|
||||
.filter(
|
||||
(p: {pattern: Pattern, patternIndex: number}) =>
|
||||
p.pattern.rules.length > 0 &&
|
||||
p.pattern.rules.every((rule: PatternRule) => rule.from !== '')
|
||||
)
|
||||
.map((_: Pattern, patternIndex: number) => {
|
||||
return patternIndex;
|
||||
});
|
||||
.map((p: {pattern: Pattern, patternIndex: number}) => p.patternIndex );
|
||||
|
||||
if (command !== undefined && command.patternFilter !== '') {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -10,5 +10,6 @@
|
|||
"1.4.1": "0.13.9",
|
||||
"2.0.0": "0.13.9",
|
||||
"2.1.0": "0.14.5",
|
||||
"2.1.1": "0.14.5"
|
||||
"2.1.1": "0.14.5",
|
||||
"2.1.2": "1.0.0"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue