dae/anki — pull request #64 by julienbaley (2014-02-18 18:18:04+00:00)
Title: Chained mods

These two commits provide support for chained modifiers, i.e. one can add {{mod1:mod2:...:modn:Field}} to a model's template. Modifiers are applied from left to right, to the exception of the modifiers type: (asking for answer to be typed) and cloze: (cloze deletion) which are always applied at the end, which adds a bit of order-independence.

The code consists mostly of replacing mentions to {{cloze: by a regexp allowing mods before/after cloze, removing the limit of 1 modifier and looping over modifiers, cumulating their effects. The second commit provides two tests, one to check that we still generate the right cloze ordinals, the other to check that chaining indeed works, with the example of {{cloze:text:Field}}.