diff --git a/manifest.json b/manifest.json index 44261c0..778af65 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "flashcards-obsidian", "name": "Flashcards", - "version": "1.1.3", + "version": "1.1.4", "minAppVersion": "0.9.17", "description": "Anki integration", "author": "Alex Colucci", diff --git a/src/services/cards.ts b/src/services/cards.ts index 3930bbb..80015ba 100644 --- a/src/services/cards.ts +++ b/src/services/cards.ts @@ -289,7 +289,7 @@ export class CardsService { public async deckNeedToBeChanged(cardsIds : number[], deckName: string) { let cardsInfo = await this.anki.cardsInfo(cardsIds) - console.log("cards infoooooo") + console.log("Flashcards: Cards info") console.log(cardsInfo) if (cardsInfo.length !== 0) { return cardsInfo[0].deckName !== deckName @@ -319,13 +319,13 @@ export class CardsService { let tags = file.match(/(?:cards-)?tags: ?(.*)/im) if (tags) { - globalTags = tags ? tags[1].split(/,|-| /) : [] - globalTags = globalTags.filter(item => item) - + globalTags = tags ? tags[1].match(/\[\[(.*?)\]\]|#(\w+)|(\w+)/gmi) : [] + for (let i = 0; i < globalTags.length; i++) { globalTags[i] = globalTags[i].replace("#", "") globalTags[i] = globalTags[i].replace(/\[\[(.*)\]\]/, '$1') globalTags[i] = globalTags[i].trim() + globalTags[i] = globalTags[i].replace(/ /g, "-") } }