mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-25 12:03:09 +00:00
2 lines
31 KiB
JavaScript
2 lines
31 KiB
JavaScript
|
"use strict";var t=require("ext.CodeMirror.v6.lib"),e=new WeakMap;function a(){return{em:"mw-em",error:"mw-error",extNowiki:"mw-ext-nowiki",extPre:"mw-ext-pre",extTag:"mw-exttag",extTagAttribute:"mw-exttag-attribute",extTagBracket:"mw-exttag-bracket",extTagName:"mw-exttag-name",freeExtLink:"mw-free-extlink",freeExtLinkProtocol:"mw-free-extlink-protocol",htmlEntity:"mw-html-entity",link:"mw-link",linkPageName:"mw-link-pagename",nowiki:"mw-tag-nowiki",pageName:"mw-pagename",pre:"mw-tag-pre",section:"mw-section",skipFormatting:"mw-skipformatting",strong:"mw-strong",tableCaption:"mw-table-caption",templateVariableDelimiter:"mw-templatevariable-delimiter"}}var i=new(function(){function i(){t._classCallCheck(this,i),t._classPrivateFieldInitSpec(this,e,{get:a,set:void 0}),this.extHighlightStyles=[],this.tokenTable=this.defaultTokenTable}return t._createClass(i,[{key:"addTag",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.tokenTable["mw-tag-".concat(t)]||(this.addToken("mw-tag-".concat(t),e),this.addToken("mw-ext-".concat(t),e))}},{key:"addToken",value:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.tokenTable[e]||(this.tokenTable[e]=t.Tag.define(a),this.extHighlightStyles.push({tag:this.tokenTable[e],class:"cm-".concat(e)}))}},{key:"permittedHtmlTags",get:function(){return{b:!0,bdi:!0,del:!0,i:!0,ins:!0,u:!0,font:!0,big:!0,small:!0,sub:!0,sup:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,cite:!0,code:!0,em:!0,s:!0,strike:!0,strong:!0,tt:!0,var:!0,div:!0,center:!0,blockquote:!0,q:!0,ol:!0,ul:!0,dl:!0,table:!0,caption:!0,pre:!0,ruby:!0,rb:!0,rp:!0,rt:!0,rtc:!0,p:!0,span:!0,abbr:!0,dfn:!0,kbd:!0,samp:!0,data:!0,time:!0,mark:!0,br:!0,wbr:!0,hr:!0,li:!0,dt:!0,dd:!0,td:!0,th:!0,tr:!0,noinclude:!0,includeonly:!0,onlyinclude:!0}}},{key:"implicitlyClosedHtmlTags",get:function(){return{br:!0,hr:!0,wbr:!0}}},{key:"tags",get:function(){return t._objectSpread2({apostrophes:"character",apostrophesBold:"strong",apostrophesItalic:"emphasis",comment:"comment",doubleUnderscore:"controlKeyword",extLink:"url",extLinkBracket:"modifier",extLinkProtocol:"namespace",extLinkText:"labelName",hr:"contentSeparator",htmlTagAttribute:"attributeName",htmlTagBracket:"angleBracket",htmlTagName:"tagName",indenting:"operatorKeyword",linkBracket:"squareBracket",linkDelimiter:"operator",linkText:"string",linkToSection:"className",list:"list",parserFunction:"unit",parserFunctionBracket:"paren",parserFunctionDelimiter:"punctuation",parserFunctionName:"keyword",sectionHeader:"heading",sectionHeader1:"heading1",sectionHeader2:"heading2",sectionHeader3:"heading3",sectionHeader4:"heading4",sectionHeader5:"heading5",sectionHeader6:"heading6",signature:"quote",tableBracket:"null",tableDefinition:"definitionOperator",tableDelimiter:"typeOperator",template:"attributeValue",templateArgumentName:"definitionKeyword",templateBracket:"bracket",templateDelimiter:"separator",templateName:"moduleKeyword",templateVariable:"atom",templateVariableBracket:"brace",templateVariableName:"variableName"},t._classPrivateFieldGet(this,e))}},{key:"defaultTokenTable",get:function(){var e;return e={},t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(e,this.tags.em,t.Tag.define()),this.tags.error,t.Tag.define()),this.tags.extNowiki,t.Tag.define()),this.tags.extPre,t.Tag.define()),this.tags.extTag,t.Tag.define()),this.tags.extTagAttribute,t.Tag.define()),this.tags.extTagBracket,t.Tag.define()),this.tags.extTagName,t.Tag.define()),this.tags.freeExtLink,t.Tag.define()),this.tags.freeExtLinkProtocol,t.Tag.define()),t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(t._defineProperty(e,this.tags.htmlEntity,t.Tag.define()),this.tags.link,t.Tag.define()),this.tags.linkPageName,t.Tag.define()),this.tags.nowiki,t.Tag.define()),this.tags.pageName,t.Tag.define()),this.tags.pre,t.Tag.define()),this.tag
|