gregorias / anki-code-highlighter

Anki plugin for code syntax highlighting.
GNU Affero General Public License v3.0
55 stars 3 forks source link

highlight.js for cloze cards? #32

Closed pedy closed 1 year ago

pedy commented 1 year ago

Is it impossible to support cloze cards with highlight.js, or it'd be a feature request?

To save time for possible further inquiries:

Lambda Capture:<br><pre style="display:flex;"><code class="language-cpp">struct S2 { void f(int i); };
void S2::f(int i)
{
&nbsp;&nbsp;&nbsp; [&amp;]{};&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // {{c1::OK: by-reference capture default}}
}</code></pre><br>

image image

gregorias commented 1 year ago

As far as I know, it's not possible, because you would need to change highlight.js to be aware of Anki-cloze mechanisms. That's why I added Pygments highlighting, to support Clozes.