mirror of
https://github.com/adanielnoel/obsidian-index-notes.git
synced 2026-07-22 10:10:26 +00:00
Removed regex lookbehinds to fix compatibility issues
This commit is contained in:
parent
7711b32e7a
commit
86d9722d68
1 changed files with 9 additions and 2 deletions
|
|
@ -51,6 +51,9 @@ function tagToHeader(t: string): string {
|
|||
* @returns {string} The block reference string.
|
||||
*/
|
||||
function tagToBlockReference(tag: string = "main-index"): string {
|
||||
if (tag.length === 0) {
|
||||
return '^indexof-root000';
|
||||
}
|
||||
return '^' + ('indexof-' + tag).replace(/[^a-zA-Z]+/g, '-');
|
||||
}
|
||||
|
||||
|
|
@ -335,8 +338,12 @@ export class IndexUpdater {
|
|||
const frontmatter = this.app.metadataCache.getCache(note.path)?.frontmatter;
|
||||
const indexNote = new IndexNote(note, this.app, this.settings);
|
||||
if (frontmatter) {
|
||||
const fileTags: string[] | undefined = frontmatter.tags;
|
||||
if (!fileTags) {
|
||||
let fileTags: string | string[] | undefined = frontmatter.tags;
|
||||
if (typeof fileTags === 'string') {
|
||||
fileTags = fileTags.split(',').map(tag => tag.trim());
|
||||
}
|
||||
if (!fileTags || !Array.isArray(fileTags)) {
|
||||
console.log("File tags are not an array: ", fileTags);
|
||||
return;
|
||||
}
|
||||
const hasPriorityTag = fileTags.includes(this.settings.priority_tag);
|
||||
|
|
|
|||
Loading…
Reference in a new issue