jasonwilliams / anki

Anki VSCode Plugin
MIT License
273 stars 31 forks source link

Remove '<h2>' when passing to Anki #81

Open rubisco57 opened 1 year ago

rubisco57 commented 1 year ago

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.

jasonwilliams commented 1 year ago

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:

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

rubisco57 commented 1 year ago

Thank you for your time, @jasonwilliams, and for guiding me in compiling my first VSCode extension. The Anki cards now follow the standard format.

jasonwilliams commented 1 year ago

@rubisco57 you don't want to offer a PR to have it fixed upstream?

jasonwilliams commented 1 year ago

This is now in https://github.com/jasonwilliams/anki/releases/tag/v1.3.0