Evolution: Option to limit quote level in reply

For the fun of it, when you save the following code blob as ~/.local/share/evolution/webkit-editor-plugins/com.example.CutQuotationLevel.js, then the next time you’ll reply to anything all the quotes for level higher than 2 will be automatically dropped. Play with the keepUpToLevel to find the accurate value for you.

Note of Evolution: Webkit editor plugin broken since 3.46.1 too.

I would attach the file, but this forum doesn’t let me attach .js files…

'use strict';

var comExampleCutQuotationLevel = {
        name : "comExampleCutQuotationLevel.js",
        setup : function(doc) {
		if (doc.body) {
			var keepUpToLevel = 2;
			var selector = "blockquote[type=cite]";
			while (keepUpToLevel > 0) {
				keepUpToLevel--;
				selector += " blockquote[type=cite]";
			}
			var elems = document.querySelectorAll(selector), ii;
			for (ii = elems.length - 1; ii >= 0; ii--) {
				elems[ii].remove();
			}
		}
        }
};

EvoEditor.RegisterPlugin(comExampleCutQuotationLevel);