mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-27 23:44:39 +00:00
Bump codemirror 5 plugin version to 5.65.19 (#9114)
* Bump codemirror 5 plugin version to 5.65.19 * Update autocomplete * Update closebrackets * Update fullscreen * Update keymap * Update modes * Update search * Update trailingspace * Fix broken markdown mode * Add all codemirror plugins to codemirrordemo edition
This commit is contained in:
@@ -1,3 +1 @@
|
||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(H){"use strict";var R=H.Pos;function z(t,e,r){return r?0<=t.indexOf(e):0==t.lastIndexOf(e,0)}H.registerHelper("hint","xml",function(t,e){var r=e&&e.schemaInfo,n=e&&e.quoteChar||'"',s=e&&e.matchInMiddle;if(r){var i=t.getCursor(),o=t.getTokenAt(i);if(o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start)),(p=H.innerMode(t.getMode(),o.state)).mode.xmlCurrentTag){var a,l,g,c=[],f=!1,h=/\btag\b/.test(o.type)&&!/>$/.test(o.string),u=h&&/^\w/.test(o.string);u?(M=t.getLine(i.line).slice(Math.max(0,o.start-2),o.start),(g=/<\/$/.test(M)?"close":/<$/.test(M)?"open":null)&&(l=o.start-("close"==g?2:1))):h&&"<"==o.string?g="open":h&&"</"==o.string&&(g="close");var d=p.mode.xmlCurrentTag(p.state);if(!h&&!d||g){u&&(a=o.string),f=g;var p,m=p.mode.xmlCurrentContext?p.mode.xmlCurrentContext(p.state):[],v=(p=m.length&&m[m.length-1])&&r[p],y=p?v&&v.children:r["!top"];if(y&&"close"!=g)for(var x=0;x<y.length;++x)a&&!z(y[x],a,s)||c.push("<"+y[x]);else if("close"!=g)for(var C in r)!r.hasOwnProperty(C)||"!top"==C||"!attrs"==C||a&&!z(C,a,s)||c.push("<"+C);p&&(!a||"close"==g&&z(p,a,s))&&c.push("</"+p+">")}else{var b=(v=d&&r[d.name])&&v.attrs,O=r["!attrs"];if(!b&&!O)return;if(b){if(O){var w={};for(var A in O)O.hasOwnProperty(A)&&(w[A]=O[A]);for(var A in b)b.hasOwnProperty(A)&&(w[A]=b[A]);b=w}}else b=O;if("string"==o.type||"="==o.string){var M,P,$,I,T,j=(M=t.getRange(R(i.line,Math.max(0,i.ch-60)),R(i.line,"string"==o.type?o.start:o.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!j||!b.hasOwnProperty(j[1])||!(P=b[j[1]]))return;"function"==typeof P&&(P=P.call(this,t)),"string"==o.type&&(a=o.string,$=0,/['"]/.test(o.string.charAt(0))&&(n=o.string.charAt(0),a=o.string.slice(1),$++),I=o.string.length,/['"]/.test(o.string.charAt(I-1))&&(n=o.string.charAt(I-1),a=o.string.substr($,I-2)),!$||(T=t.getLine(i.line)).length>o.end&&T.charAt(o.end)==n&&o.end++,f=!0);var q=function(t){if(t)for(var e=0;e<t.length;++e)a&&!z(t[e],a,s)||c.push(n+t[e]+n);return k()};return P&&P.then?P.then(q):q(P)}for(var L in"attribute"==o.type&&(a=o.string,f=!0),b)!b.hasOwnProperty(L)||a&&!z(L,a,s)||c.push(L)}return k()}}function k(){return{list:c,from:f?R(i.line,null==l?o.start:l):i,to:f?R(i.line,o.end):i}}})});
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function($){"use strict";var I=$.Pos;function T(t,e,r){return r?0<=t.indexOf(e):0==t.lastIndexOf(e,0)}$.registerHelper("hint","xml",function(t,e){var r=e&&e.schemaInfo,n=e&&e.quoteChar||'"',s=e&&e.matchInMiddle;if(r){var i=t.getCursor(),o=t.getTokenAt(i);if(o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start)),(e=$.innerMode(t.getMode(),o.state)).mode.xmlCurrentTag){var a,l=[],g=!1,c=/\btag\b/.test(o.type)&&!/>$/.test(o.string),f=c&&/^\w/.test(o.string),h=(f?(O=t.getLine(i.line).slice(Math.max(0,o.start-2),o.start),(M=/<\/$/.test(O)?"close":/<$/.test(O)?"open":null)&&(a=o.start-("close"==M?2:1))):c&&"<"==o.string?M="open":c&&"</"==o.string&&(M="close"),e.mode.xmlCurrentTag(e.state));if(!c&&!h||M){f&&(A=o.string);var g=M,c=e.mode.xmlCurrentContext?e.mode.xmlCurrentContext(e.state):[],u=(e=c.length&&c[c.length-1])&&r[e],d=e?u&&u.children:r["!top"];if(d&&"close"!=M)for(var p=0;p<d.length;++p)A&&!T(d[p],A,s)||l.push("<"+d[p]);else if("close"!=M)for(var m in r)!r.hasOwnProperty(m)||"!top"==m||"!attrs"==m||A&&!T(m,A,s)||l.push("<"+m);e&&(!A||"close"==M&&T(e,A,s))&&l.push("</"+e+">")}else{var y,x=(u=h&&r[h.name])&&u.attrs,v=r["!attrs"];if(!x&&!v)return;if(x){if(v){var C,b={};for(C in v)v.hasOwnProperty(C)&&(b[C]=v[C]);for(C in x)x.hasOwnProperty(C)&&(b[C]=x[C]);x=b}}else x=v;if("string"==o.type||"="==o.string){var O,w,A,M,f=(O=t.getRange(I(i.line,Math.max(0,i.ch-60)),I(i.line,"string"==o.type?o.start:o.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!f||!x.hasOwnProperty(f[1])||!(w=x[f[1]]))return;"function"==typeof w&&(w=w.call(this,t)),"string"==o.type&&(A=o.string,/['"]/.test(o.string.charAt(c=0))&&(n=o.string.charAt(0),A=o.string.slice(1),c++),M=o.string.length,/['"]/.test(o.string.charAt(M-1))&&(n=o.string.charAt(M-1),A=o.string.substr(c,M-2)),c&&(e=t.getLine(i.line)).length>o.end&&e.charAt(o.end)==n&&o.end++,g=!0);h=function(t){if(t)for(var e=0;e<t.length;++e)A&&!T(t[e],A,s)||l.push(n+t[e]+n);return P()};return w&&w.then?w.then(h):h(w)}for(y in"attribute"==o.type&&(A=o.string,g=!0),x)!x.hasOwnProperty(y)||A&&!T(y,A,s)||l.push(y)}return P()}}function P(){return{list:l,from:g?I(i.line,null==a?o.start:a):i,to:g?I(i.line,o.end):i}}})});
|
||||
Reference in New Issue
Block a user