CodeMirror offers a very convenient and light piece of code to fold code between curly braces. Very cool for the JavaScript editor into my codemirror2-based branch of BlueGriffon but not enough for the Source view of BlueGriffon itself. I needed to fold tags and not code so I wrote my own codemirror "plugin" for that. It's available here, licensing terms are included in the file. Enjoy !

Source view with one folded element