Obsidian_to_Anki
Obsidian_to_Anki copied to clipboard
Allow Cards to be inside/in form of a code block
Hi there!
I was just wondering if there was a specific reason on why Obsidian_to_Anki ignores Code Blocks.
I have the Admonition Plugin installed, which creates material styled, themable, collapsable blocks, which I would love to use as flashcards like so:
Which would then be rendered like so:
The RegEx for this would be
(?:```ad-flashcard\n+)((?:.+\n)*?)(?:_{3,}\n)((?:.+\n)*?)(?:`{3}\n?)
Sadly - after hours of trying to find the mistake in my RegEx - I noticed, that the problem actually lies in the code block itself. OtA seems to ignore it completely.
Is there a way to make this work?
Thanks.
I just found out, that you can make it work by commenting out this Line:
this.ignore_spans.push(...spans(c.OBS_CODE_REGEXP, this.file))
In this file
Still I am wondering what the reason for this line is. I don't feel quite comfortable doing this when it could have severe side effects.
Does anyone have an answer to this question?
Would love a better solution to this, as well!
@marvin-te thanks for the suggestion above - though it doesn't work as intended, as the curly brackets in the code will act as random cards.
@Pseudonium would it be possible to have another notation for cards inside code? PS. thank you for an amazing plugin! It is seriously the most underrated workflow!!