You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
6.7 KiB
1 line
6.7 KiB
"use strict";(self.webpackChunkjupyter_web=self.webpackChunkjupyter_web||[]).push([[4780],{24780:(L,s,b)=>{b.r(s),b.d(s,{textile:()=>T});var a={addition:"inserted",attributes:"propertyName",bold:"strong",cite:"keyword",code:"monospace",definitionList:"list",deletion:"deleted",div:"punctuation",em:"emphasis",footnote:"variable",footCite:"qualifier",header:"heading",html:"comment",image:"atom",italic:"emphasis",link:"link",linkDefinition:"link",list1:"list",list2:"list.special",list3:"list",notextile:"string.special",pre:"operator",p:"content",quote:"bracket",span:"quote",specialChar:"character",strong:"strong",sub:"content.special",sup:"content.special",table:"variableName.special",tableHeading:"operator"};function y(i,e,n){if("_"===n)return i.eat("_")?f(i,e,"italic",/__/,2):f(i,e,"em",/_/,1);if("*"===n)return i.eat("*")?f(i,e,"bold",/\*\*/,2):f(i,e,"strong",/\*/,1);if("["===n)return i.match(/\d+\]/)&&(e.footCite=!0),o(e);if("("===n&&i.match(/^(r|tm|c)\)/))return a.specialChar;if("<"===n&&i.match(/(\w+)[^>]+>[^<]+<\/\1>/))return a.html;if("?"===n&&i.eat("?"))return f(i,e,"cite",/\?\?/,2);if("="===n&&i.eat("="))return f(i,e,"notextile",/==/,2);if("-"===n&&!i.eat("-"))return f(i,e,"deletion",/-/,1);if("+"===n)return f(i,e,"addition",/\+/,1);if("~"===n)return f(i,e,"sub",/~/,1);if("^"===n)return f(i,e,"sup",/\^/,1);if("%"===n)return f(i,e,"span",/%/,1);if("@"===n)return f(i,e,"code",/@/,1);if("!"===n){var c=f(i,e,"image",/(?:\([^\)]+\))?!/,1);return i.match(/^:\S+/),c}return o(e)}function f(i,e,n,u,c){var d=i.pos>c?i.string.charAt(i.pos-c-1):null,p=i.peek();if(e[n]){if((!p||/\W/.test(p))&&d&&/\S/.test(d)){var v=o(e);return e[n]=!1,v}}else(!d||/\W/.test(d))&&p&&/\S/.test(p)&&i.match(new RegExp("^.*\\S"+u.source+"(?:\\W|$)"),!1)&&(e[n]=!0,e.mode=r.attributes);return o(e)}function o(i){var e=h(i);if(e)return e;var n=[];return i.layoutType&&n.push(a[i.layoutType]),n=n.concat(function m(i){for(var e=[],n=1;n<arguments.length;++n)i[arguments[n]]&&e.push(a[arguments[n]]);return e}(i,"addition","bold","cite","code","deletion","em","footCite","image","italic","link","span","strong","sub","sup","table","tableHeading")),"header"===i.layoutType&&n.push(a.header+"-"+i.header),n.length?n.join(" "):null}function h(i){var e=i.layoutType;switch(e){case"notextile":case"code":case"pre":return a[e];default:return i.notextile?a.notextile+(e?" "+a[e]:""):null}}var t={cache:{},single:{bc:"bc",bq:"bq",definitionList:/- .*?:=+/,definitionListEnd:/.*=:\s*$/,div:"div",drawTable:/\|.*\|/,foot:/fn\d+/,header:/h[1-6]/,html:/\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(i){switch(i){case"drawTable":return t.makeRe("^",t.single.drawTable,"$");case"html":return t.makeRe("^",t.single.html,"(?:",t.single.html,")*","$");case"linkDefinition":return t.makeRe("^",t.single.linkDefinition,"$");case"listLayout":return t.makeRe("^",t.single.list,l("allAttributes"),"*\\s+");case"tableCellAttributes":return t.makeRe("^",t.choiceRe(t.single.tableCellAttributes,l("allAttributes")),"+\\.");case"type":return t.makeRe("^",l("allTypes"));case"typeLayout":return t.makeRe("^",l("allTypes"),l("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return t.makeRe("^",l("allAttributes"),"+");case"allTypes":return t.choiceRe(t.single.div,t.single.foot,t.single.header,t.single.bc,t.single.bq,t.single.notextile,t.single.pre,t.single.table,t.single.para);case"allAttributes":return t.choiceRe(t.attributes.selector,t.attributes.css,t.attributes.lang,t.attributes.align,t.attributes.pad);default:return t.makeRe("^",t.single[i])}},makeRe:function(){for(var i="",e=0;e<arguments.length;++e){var n=arguments[e];i+="string"==typeof n?n:n.source}return new RegExp(i)},choiceRe:function(){for(var i=[arguments[0]],e=1;e<arguments.length;++e)i[2*e-1]="|",i[2*e]=arguments[e];return i.unshift("(?:"),i.push(")"),t.makeRe.apply(null,i)}};function l(i){return t.cache[i]||(t.cache[i]=t.createRe(i))}var r={newLayout:function(i,e){return i.match(l("typeLayout"),!1)?(e.spanningLayout=!1,(e.mode=r.blockType)(i,e)):(h(e)||(i.match(l("listLayout"),!1)?n=r.list:i.match(l("drawTable"),!1)?n=r.table:i.match(l("linkDefinition"),!1)?n=r.linkDefinition:i.match(l("definitionList"))?n=r.definitionList:i.match(l("html"),!1)&&(n=r.html)),(e.mode=n||r.text)(i,e));var n},blockType:function(i,e){var n,u;return e.layoutType=null,(n=i.match(l("type")))?((n=(u=n[0]).match(l("header")))?(e.layoutType="header",e.header=parseInt(n[0][1])):u.match(l("bq"))?e.layoutType="quote":u.match(l("bc"))?e.layoutType="code":u.match(l("foot"))?e.layoutType="footnote":u.match(l("notextile"))?e.layoutType="notextile":u.match(l("pre"))?e.layoutType="pre":u.match(l("div"))?e.layoutType="div":u.match(l("table"))&&(e.layoutType="table"),e.mode=r.attributes,o(e)):(e.mode=r.text)(i,e)},text:function(i,e){if(i.match(l("text")))return o(e);var n=i.next();return'"'===n?(e.mode=r.link)(i,e):y(i,e,n)},attributes:function(i,e){return e.mode=r.layoutLength,i.match(l("attributes"))?a.attributes:o(e)},layoutLength:function(i,e){return i.eat(".")&&i.eat(".")&&(e.spanningLayout=!0),e.mode=r.text,o(e)},list:function(i,e){var n=i.match(l("list"));e.listDepth=n[0].length;var u=(e.listDepth-1)%3;return e.layoutType=u?1===u?"list2":"list3":"list1",e.mode=r.attributes,o(e)},link:function(i,e){return e.mode=r.text,i.match(l("link"))?(i.match(/\S+/),a.link):o(e)},linkDefinition:function(i){return i.skipToEnd(),a.linkDefinition},definitionList:function(i,e){return i.match(l("definitionList")),e.layoutType="definitionList",i.match(/\s*$/)?e.spanningLayout=!0:e.mode=r.attributes,o(e)},html:function(i){return i.skipToEnd(),a.html},table:function(i,e){return e.layoutType="table",(e.mode=r.tableCell)(i,e)},tableCell:function(i,e){return i.match(l("tableHeading"))?e.tableHeading=!0:i.eat("|"),e.mode=r.tableCellAttributes,o(e)},tableCellAttributes:function(i,e){return e.mode=r.tableText,i.match(l("tableCellAttributes"))?a.attributes:o(e)},tableText:function(i,e){return i.match(l("tableText"))?o(e):"|"===i.peek()?(e.mode=r.tableCell,o(e)):y(i,e,i.next())}};const T={name:"textile",startState:function(){return{mode:r.newLayout}},token:function(i,e){return i.sol()&&function g(i,e){e.mode=r.newLayout,e.tableHeading=!1,"definitionList"===e.layoutType&&e.spanningLayout&&i.match(l("definitionListEnd"),!1)&&(e.spanningLayout=!1)}(i,e),e.mode(i,e)},blankLine:function k(i){var e=i.spanningLayout,n=i.layoutType;for(var u in i)i.hasOwnProperty(u)&&delete i[u];i.mode=r.newLayout,e&&(i.layoutType=n,i.spanningLayout=!0)}}}}]); |