anki
anki copied to clipboard
Remove '<h2>' when passing to Anki
Thank you for sharing this plugin!
I would like to remove the h2 tag resulting from the usage of markdown level 2 headings as card separator. It is nice for visual display in vscode, but ugly on the flashcards. Mapping ## to another tag in the conversion or just nothing, would be a good solution. Could you provide some build instructions? I could not get it to work, as it is the first time I am using esbuild.
Mapping ## to another tag in the conversion or just nothing, would be a good solution.
I think you're right, we can probably just map it to nothing which may be better than a H2. Looks like we already do this for cloze cards so could probably just do it across the board.
I could not get it to work, as it is the first time I am using esbuild
You shouldn't need to do anything special with esbuild, just:
- $ npm install
- $ npm run watch
- Make sure Anki is up and running
- in VSCode go to debug and launch "Run Extension"
This should give you access to a debug view, you may need to disable the production version of the extension while you do this. Once the above works you can start off by breakpointing here https://github.com/jasonwilliams/anki/blob/main/src/markdown/parsers/cardParser.ts#L61
Thank you for your time, @jasonwilliams, and for guiding me in compiling my first VSCode extension. The Anki cards now follow the standard format.
@rubisco57 you don't want to offer a PR to have it fixed upstream?
This is now in https://github.com/jasonwilliams/anki/releases/tag/v1.3.0