I have a markdown-it content script that contains a rule like this:
markdownIt.renderer.rules["some_token_name"] = function (
tokens,
idx,
options
) {
return "<tag>some custom content</tag>";
};
I want to execute some js code when the above tag gets rendered by the note viewer. I tried including a <script>
tag but it does not work (it does not throw errors but the code is not executed).
The only workaround I found (here) that was working correctly was to include the js code like this:
<style onload="some js code" />
This executes the JS code but, for some reason, the note viewer does not render anything after the first token that contains the <style>
tag.
Does anybody know a trick to solve this issue?
Thanks in advance.