Skip to content

Conversation

@st3v3nmw
Copy link
Contributor

This should fix #196 where Obsidian tags in regex notes aren't added to Anki.

@st3v3nmw st3v3nmw changed the title fix addition of Obsidian tags in regex notes fixed addition of Obsidian tags in regex notes Mar 12, 2021
@dummifiedme
Copy link

Is this included in the current version? @st3v3nmw .
If not, how can I manually fix it?
I checked the code, it seems to be the same. But my tags aren't getting picked

@st3v3nmw
Copy link
Contributor Author

st3v3nmw commented May 29, 2021

It's not currently included.
To manually fix it, clone my fork of this repository, install NodeJS, and run npm i inside the folder.
Then run npm run dev to compile main.ts to main.js. Then replace the main.js file in the plugin's folder in .obsidian/plugins.

@dummifiedme
Copy link

To manually fix it, clone my fork of this repository, install NodeJS, and run npm i inside the folder.

npm WARN tarball tarball data for obsidian@https://github.com/obsidianmd/obsidian-api/tarball/master (sha512-OGZPxkzYJ1Lgjd4f7eaBFr8KqIG8vkwVcOblH5BMSIoMieY1NmXL9/ouVwMjc1NJH7ZN6Zi7Qclz8Y42fd8rwQ==) seems to be corrupted. Trying one more time.
npm ERR! code EINTEGRITY
npm ERR! sha512-OGZPxkzYJ1Lgjd4f7eaBFr8KqIG8vkwVcOblH5BMSIoMieY1NmXL9/ouVwMjc1NJH7ZN6Zi7Qclz8Y42fd8rwQ== integrity checksum failed when using sha512: wanted sha512-OGZPxkzYJ1Lgjd4f7eaBFr8KqIG8vkwVcOblH5BMSIoMieY1NmXL9/ouVwMjc1NJH7ZN6Zi7Qclz8Y42fd8rwQ== but got sha512-09/Zpb7sXE264OLk3DDbieU895d6NaNIIL8eyKR+5WpXPSYKeDfwy4yQh3WSb6KHWTJpbyvqUDchh8Yy4lHiRQ==. (15583 bytes)

Also, will I lose the settings of the plugin if I make a complete change in the plugin folder?

Can't I just fix the part where you have modified the code?

From comparison, I could see 2 places where there were a semicolon and has been removed in the new code...

@st3v3nmw
Copy link
Contributor Author

Try deleting the package-lock.json file and try again.

Also, will I lose the settings of the plugin if I make a complete change in the plugin folder?

No. You'll only change the main.js file. The settings are stored in data.json.

Also, I've made a release on my fork that you can easily download and use.

@dummifiedme
Copy link

dummifiedme commented May 31, 2021 via email

@rjbergerud
Copy link

bump - would really love this functionality!

@ludvigalden
Copy link

ludvigalden commented Oct 17, 2021

Why is this not being merged? Just made a similar pull request (#287) that does not include changes to gitignore or the lockfile, if that's the problem. I closed my pull request because I found out about this one.

@dummifiedme
Copy link

Why is this not being merged? Just made a similar pull request (#287) that does not include changes to gitignore or the lockfile, if that's the problem. I closed my pull request because I found out about this one.

Because the developer is away since the last release :)

@timjden
Copy link

timjden commented Nov 1, 2021

Thanks @st3v3nmw ! This has been most frustrating up until now. Much appreciated. I cloned your fork but hopefully it will be merged soon.

@ghost
Copy link

ghost commented May 30, 2023

It's not currently included. To manually fix it, clone my fork of this repository, install NodeJS, and run npm i inside the folder. Then run npm run dev to compile main.ts to main.js. Then replace the main.js file in the plugin's folder in .obsidian/plugins.

I replaced with the one you released. It seems not working..

@lsolesen
Copy link

@Pseudonium - is this something that is goint to be implemented soon?

@ShootingKing-AM
Copy link
Member

ShootingKing-AM commented Jan 7, 2024

E2E tests for this fix are done in #479

Though its late, Thanks for the bugfix !

@ShootingKing-AM ShootingKing-AM changed the title fixed addition of Obsidian tags in regex notes fix: Bug obsidian tags not being added for regex notes Jan 7, 2024
@ShootingKing-AM ShootingKing-AM added the fix Fixed some bug/issue label Jan 7, 2024
@ShootingKing-AM ShootingKing-AM merged commit a5e1473 into ObsidianToAnki:master Jan 7, 2024
@ShootingKing-AM ShootingKing-AM linked an issue Jan 19, 2024 that may be closed by this pull request
@CCerrer
Copy link

CCerrer commented Sep 7, 2025

The pull request is merged, why the "Tags" seem to only work on the same line of answer?

I tried the same regex as the issue #196: ^Q: ((?:.+\n)*)\n*A: (.+(?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))*)
with the examples:

#tag_up
Q: question 1 #tag_question
A: answer example 1 #tag_answer
#tag_above
<!--ID: 1757264898513-->



Tags: #tag_up
Q: question 2 Tags: #tag_question
A: answer example 2 Tags: #tag_answer
<!--ID: 1757264898508-->

Tags: #tag_above


Tags: #tag_up
Q: question 3 Tags: #tag_question
A: answer example 3 #tag_answer
<!--ID: 1757264907731-->


Tags: #tag_above

And got a tag only at the inline example:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fixed some bug/issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Could not create Neuracache flashcard with tags Tags do not get into Anki when using QA-style regex

8 participants