Rewrite formatting.js to use available mode tokenizer
Rewrite formatting.js to use available mode tokenizer

Remove a bunch of regexp kludges that never really worked.

Will need to be tested more rigorously (I only tried the existing demo).

sekcheong/CodeMirror,jhnesk/CodeMirror,ThebingServices/CodeMirror,TDaglis/CodeMirror,jayaprabhakar/CodeMirror,anthonygego/CodeMirror,hccampos/CodeMirror,isdampe/CodeMirror,Dominator008/CodeMirror,camellhf/CodeMirror,explorigin/CodeMirror,ashmind/CodeMirror,hackmdio/CodeMirror,shiren/CodeMirror,nightwing/CodeMirror,systay/CodeMirror,supriyantomaftuh/CodeMirror,angelozerr/CodeMirror,sourcelair/CodeMirror,wbinnssmith/CodeMirror,cben/CodeMirror,TDaglis/CodeMirror,adobe/CodeMirror2,qweasd1/CodeMirror,trumanliu/CodeMirror,mightyguava/CodeMirror,camellhf/CodeMirror,systay/CodeMirror,cintiamh/CodeMirror,abdelouahabb/CodeMirror,davidpham87/CodeMirror,loopspace/CodeMirror,EasonYi/CodeMirror,dperetti/CodeMirror,symbla/CodeMirror,kangkot/CodeMirror,schanzer/CodeMirror,jochenberger/CodeMirror,dudb/CodeMirror,DustinH/CodeMirror,notepadqq/CodeMirror,nawroth/CodeMirror,jkaplon/CodeMirror,xeronith/CodeMirror,bgrins/CodeMirror,InternetGuru/CodeMirror,jhnesk/CodeMirror,trumanliu/CodeMirror,Navaneethsen/CodeMirror,happibum/CodeMirror-main,SidPresse/CodeMirror,kuangyeheng/CodeMirror,fmoliveira/CodeMirror,ssxxue/CodeMirror,KamranMackey/CodeMirror,Icenium/CodeMirror,anthonygego/CodeMirror,djadmin/CodeMirror,d0liver/CodeMirror,skylarkcob/CodeMirror,increpare/CodeMirror,mtaran-google/CodeMirror,d0liver/CodeMirror,AlanWasTaken/codemirror,axter/CodeMirror,sourcelair/CodeMirror,thomasjm/CodeMirror,jpolitz/CodeMirror,Ermlab/CodeMirror,Jisuanke/CodeMirror,bfrohs/CodeMirror,dudb/CodeMirror,buchslava/CodeMirror,sgoo/CodeMirror,wingify/CodeMirror,bfrohs/CodeMirror,qiankun007/CodeMirror,vanloswang/CodeMirror,djadmin/CodeMirror,loopspace/CodeMirror,karevn/CodeMirror,pjkui/CodeMirror,Jisuanke/CodeMirror,nightwing/CodeMirror,Navaneethsen/CodeMirror,happibum/CodeMirror-main,antimatter15/CodeMirror,flyskyko/CodeMirror,rasata/CodeMirror,karevn/CodeMirror,joshterrell805-historic/CodeMirror,mihailik/CodeMirror,jansel/CodeMirror,crazy4chrissi/CodeMirror,kerabromsmu/CodeMirror,sanyaade-iot/CodeMirror,vincentwoo/CodeMirror,flyskyko/CodeMirror,ejgallego/CodeMirror,ejgallego/CodeMirror,belph/CodeMirror,antimatter15/CodeMirror,namin/CodeMirror,ZombieHippie/CodeMirror,ksanaforge/CodeMirror,elisee/CodeMirror,Ermlab/CodeMirror,ssxxue/CodeMirror,wbinnssmith/CodeMirror,sekcheong/CodeMirror,grzegorzmazur/CodeMirror,dudb/CodeMirror,rustemferreira/CodeMirror,amsul/CodeMirror,amireh/codemirror,mightyguava/CodeMirror,amsul/CodeMirror,SidPresse/CodeMirror,alur/CodeMirror,bfrohs/CodeMirror,symbla/CodeMirror,Icenium/CodeMirror,axter/CodeMirror,thomasjm/CodeMirror,Allenice/CodeMirror,bocharsky-bw/CodeMirror,michaelerobertsjr/CodeMirror,morrisonwudi/CodeMirror,shiren/CodeMirror,gkoberger/CodeMirror,wingify/CodeMirror,morrisonwudi/CodeMirror,pjkui/CodeMirror,melpon/CodeMirror,webida/CodeMirror,apatawari/CodeMirror,nawroth/CodeMirror,InternetGuru/CodeMirror,AlanWasTaken/codemirror,davidpham87/CodeMirror,ssxxue/CodeMirror,codio/CodeMirror,gkoberger/CodeMirror,webida/CodeMirror,sgoo/CodeMirror,jpolitz/CodeMirror,Carreau/CodeMirror,NeZaMy/CodeMirror2,symbla/CodeMirror,GerHobbelt/CodeMirror2,DustinH/CodeMirror,angelozerr/CodeMirror,fmoliveira/CodeMirror,djadmin/CodeMirror,apatawari/CodeMirror,agendor/CodeMirror,AlanWasTaken/codemirror,ashmind/CodeMirror,kevinushey/CodeMirror,pinbe/CodeMirror,tpphu/CodeMirror,jessegrosjean/CodeMirror,CartoDB/CodeMirror,pjkui/CodeMirror,explorigin/CodeMirror,pabloferz/CodeMirror,elisee/CodeMirror,Dominator008/CodeMirror,elisee/CodeMirror,thomasjm/CodeMirror,hackmdio/CodeMirror,TechnicalPursuit/CodeMirror,vincentwoo/CodeMirror,EasonYi/CodeMirror,schanzer/CodeMirror,rasata/CodeMirror,ZombieHippie/CodeMirror,jayaprabhakar/CodeMirror,mihailik/CodeMirror,Aliccer/CodeMirror,hackmdio/CodeMirror,tpphu/CodeMirror,jkaplon/CodeMirror,MarcelGerber/CodeMirror,notepadqq/CodeMirror,CartoDB/CodeMirror,jochenberger/CodeMirror,cintiamh/CodeMirror,abdelouahabb/CodeMirror,Navaneethsen/CodeMirror,matthewbauer/CodeMirror,michaelerobertsjr/CodeMirror,supriyantomaftuh/CodeMirror,alur/CodeMirror,INTELOGIE/CodeMirror,matthewbauer/CodeMirror,fmoliveira/CodeMirror,rustemferreira/CodeMirror,namin/CodeMirror,sourcelair/CodeMirror,kerabromsmu/CodeMirror,jpolitz/CodeMirror,Jisuanke/CodeMirror,Carreau/CodeMirror,jessegrosjean/CodeMirror,ksanaforge/CodeMirror,ejgallego/CodeMirror,morrisonwudi/CodeMirror,Aliccer/CodeMirror,TDaglis/CodeMirror,jessegrosjean/CodeMirror,matthewbauer/CodeMirror,KamranMackey/CodeMirror,increpare/CodeMirror,bluesh55/CodeMirror,kevinushey/CodeMirror,antimatter15/CodeMirror,webida/CodeMirror,sanyaade-iot/CodeMirror,philuchansky/CodeMirror,crazy4chrissi/CodeMirror,NumbersInternational/CodeMirror,DustinH/CodeMirror,melpon/CodeMirror,davidpham87/CodeMirror,mtaran-google/CodeMirror,kolya-ay/CodeMirror,nawroth/CodeMirror,grzegorzmazur/CodeMirror,ZombieHippie/CodeMirror,mizchi/CodeMirror,alur/CodeMirror,INTELOGIE/CodeMirror,kuangyeheng/CodeMirror,MarcelGerber/CodeMirror,rrandom/CodeMirror,NumbersInternational/CodeMirror,anthonygego/CodeMirror,mihailik/CodeMirror,dperetti/CodeMirror,belph/CodeMirror,dbarnett/CodeMirror,bgrins/CodeMirror,agendor/CodeMirror,sekcheong/CodeMirror,belph/CodeMirror,buchslava/CodeMirror,TechnicalPursuit/CodeMirror,apatawari/CodeMirror,Allenice/CodeMirror,shiren/CodeMirror,NeZaMy/CodeMirror2,ficristo/CodeMirror,melpon/CodeMirror,bocharsky-bw/CodeMirror,cben/CodeMirror,manderson23/CodeMirror,axter/CodeMirror,KamranMackey/CodeMirror,skylarkcob/CodeMirror,pinbe/CodeMirror,kangkot/CodeMirror,ficristo/CodeMirror,pabloferz/CodeMirror,fivetran/CodeMirror,ashmind/CodeMirror,increpare/CodeMirror,kuangyeheng/CodeMirror,mizchi/CodeMirror,ksanaforge/CodeMirror,kerabromsmu/CodeMirror,jkaplon/CodeMirror,camellhf/CodeMirror,buchslava/CodeMirror,philuchansky/CodeMirror,isdampe/CodeMirror,r7kamura/CodeMirror,mizchi/CodeMirror,dperetti/CodeMirror,crazy4chrissi/CodeMirror,grzegorzmazur/CodeMirror,sanyaade-iot/CodeMirror,adobe/CodeMirror2,kk9599/CodeMirror,ThebingServices/CodeMirror,systay/CodeMirror,vanloswang/CodeMirror,ThebingServices/CodeMirror,INTELOGIE/CodeMirror,cintiamh/CodeMirror,kangkot/CodeMirror,fpco/codemirror,wingify/CodeMirror,hccampos/CodeMirror,karthikeyansam/CodeMirror,karthikeyansam/CodeMirror,d0liver/CodeMirror,r7kamura/CodeMirror,kk9599/CodeMirror,NeZaMy/CodeMirror2,manderson23/CodeMirror,pinbe/CodeMirror,Aliccer/CodeMirror,loopspace/CodeMirror,rasata/CodeMirror,mightyguava/CodeMirror,kk9599/CodeMirror,amshali/CodeMirror,pabloferz/CodeMirror,notepadqq/CodeMirror,dbarnett/CodeMirror,michaelerobertsjr/CodeMirror,supriyantomaftuh/CodeMirror,ficristo/CodeMirror,TechnicalPursuit/CodeMirror,r7kamura/CodeMirror,qiankun007/CodeMirror,dbarnett/CodeMirror,jansel/CodeMirror,SidPresse/CodeMirror,qweasd1/CodeMirror,joshterrell805-historic/CodeMirror,amshali/CodeMirror,bluesh55/CodeMirror,NumbersInternational/CodeMirror,rrandom/CodeMirror,abdelouahabb/CodeMirror,GerHobbelt/CodeMirror2,happibum/CodeMirror-main,gkoberger/CodeMirror,schanzer/CodeMirror,fpco/codemirror,adobe/CodeMirror2,bgrins/CodeMirror,bocharsky-bw/CodeMirror,InternetGuru/CodeMirror,jayaprabhakar/CodeMirror,codio/CodeMirror,isdampe/CodeMirror,mtaran-google/CodeMirror,skylarkcob/CodeMirror,hccampos/CodeMirror,agendor/CodeMirror,nightwing/CodeMirror,flyskyko/CodeMirror,amshali/CodeMirror,EasonYi/CodeMirror,namin/CodeMirror,karevn/CodeMirror,MarcelGerber/CodeMirror,rrandom/CodeMirror,Icenium/CodeMirror,qiankun007/CodeMirror,rustemferreira/CodeMirror,karthikeyansam/CodeMirror,vincentwoo/CodeMirror,fivetran/CodeMirror,Allenice/CodeMirror,bluesh55/CodeMirror,webida/CodeMirror,trumanliu/CodeMirror,codio/CodeMirror,tpphu/CodeMirror,qweasd1/CodeMirror,xeronith/CodeMirror,xeronith/CodeMirror,kolya-ay/CodeMirror,manderson23/CodeMirror,philuchansky/CodeMirror,vanloswang/CodeMirror,Dominator008/CodeMirror