refactor: reorganize replace-links module and add ignoreCase option

This commit is contained in:
Kodai Nakamura 2025-02-22 20:38:37 +09:00
parent f6214f97c8
commit 36aadfea6b
4 changed files with 2 additions and 19 deletions

View file

@ -9,7 +9,7 @@ import {
PluginManifest,
} from "obsidian";
import { PathAndAliases } from "./path-and-aliases.types";
import { replaceLinks } from "./replace-links";
import { replaceLinks } from "./replace-links/replace-links";
import { formatGitHubURL } from "./replace-urls/github";
import { formatJiraURL } from "./replace-urls/jira";
import { AutomaticLinkerPluginSettingsTab } from "./settings/settings";

View file

@ -1,2 +0,0 @@
export { replaceLinks } from "./replace-links";
export type { ReplaceLinksOptions } from "./types";

View file

@ -21,6 +21,7 @@ export const replaceLinks = ({
namespaceResolution?: boolean;
baseDir?: string;
ignoreDateFormats?: boolean;
ignoreCase?: boolean;
};
}): string => {
// Return the body unchanged if its length is below the minimum character count.

View file

@ -1,16 +0,0 @@
import { CandidateData, TrieNode } from "../trie";
export interface ReplaceLinksOptions {
body: string;
linkResolverContext: {
filePath: string;
trie: TrieNode;
candidateMap: Map<string, CandidateData>;
};
settings?: {
minCharCount?: number;
namespaceResolution?: boolean;
baseDir?: string;
ignoreDateFormats?: boolean;
};
}