absent-sapphire•7mo ago
Where is the JS logic that handles curly braces {} that ignore syntax?
For a very long time I have been using a card format from MIA times that is still compatible with the current Migaku syntax, with a lot of my own customizations that I would like to preserve. The only thing that is missing is that it doesn’t handle the curly braces that are used for ignoring the special syntax. The old plug-ins didn’t use them but now I basically have to remove them manually every time I create a new card with Migaku, because instead of being used for ignoring syntax, the {} appear in the card output.
I have been skimming through the JavaScript used by the Migaku note types and it seems it’s mostly the same logic, but I can’t nail where exactly the braces {} are handled.
Is it possible to get some directions of where is that? I would like to copy it manually to my own card type.
8 Replies
flat-fuchsia•7mo ago
@Henrik (JST)
typical-coral•5mo ago
just letting you know I have the same issue and I would also like a solution for this 🙏
xenial-black•5mo ago
It would probably be easier to port your customizations to the Migaku Card Template.
typical-coral•5mo ago
I doubt it, given I have been using jp-mining-note which is a fairly complex card type
quickest-silver•5mo ago
i have the same note type, do you know how to get the ptich accent and stuff to work with migaku's syntax, or do you just export with no syntax?
absent-sapphireOP•5mo ago
in my case I have been using the MIA Jpn DX (the last version shared in MIA where you could select between audio/text vocab/sentence based on note fields, very similar to what the Migaku note type does) and when I wrote this question I thought they were almost the same javascript, but ....
then realized I basically have the javascript of both! 😅
this frankenstein of a note, has both the "MIGAKU JAPANESE SUPPORT JS STARTS..." and "MIA JAPANESE SUPPORT JS START" code inside, but is still functional somehow
I'm gonna try to play a little bit to see if I can remove the MIA JS and have the Migaku JS use my div classes (my customizations are just things like randomize fonts and hidding fields until clicking a button)
ok, it's easier than I thought, I just had to remove the MIA JS section, leaving only the Migaku one, then replace the "wrapped-japanese" div class with the "field" div class that Migaku uses
typical-coral•5mo ago
ok it was a fairly easy solution for me too
typical-coral•5mo ago
it was just a matter of adding the migaku field class to the sentence field and that removes the brackets
