From: Tim Düsterhus Date: Mon, 1 Jul 2019 17:50:38 +0000 (+0200) Subject: Update prism X-Git-Tag: 5.2.0_Alpha_1~1^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=402514010fa58e0c8806801bfb09dd27ea63a39c;p=GitHub%2FWoltLab%2FWCF.git Update prism --- diff --git a/wcfsetup/install/files/js/3rdParty/prism/components.json b/wcfsetup/install/files/js/3rdParty/prism/components.json index bb6d07da1f..2f8c5a6080 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components.json +++ b/wcfsetup/install/files/js/3rdParty/prism/components.json @@ -78,6 +78,10 @@ "title": "ABAP", "owner": "dellagustin" }, + "abnf": { + "title": "Augmented Backus–Naur form", + "owner": "RunDevelopment" + }, "actionscript": { "title": "ActionScript", "require": "javascript", @@ -110,6 +114,7 @@ "owner": "Golmote" }, "asciidoc": { + "alias": "adoc", "title": "AsciiDoc", "owner": "Golmote" }, @@ -144,7 +149,6 @@ }, "batch": { "title": "Batch", - "alias": "shell", "owner": "Golmote" }, "bison": { @@ -152,6 +156,14 @@ "require": "c", "owner": "Golmote" }, + "bnf": { + "title": "Backus–Naur form", + "alias": "rbnf", + "aliasTitles": { + "rbnf": "Routing Backus–Naur form" + }, + "owner": "RunDevelopment" + }, "brainfuck": { "title": "Brainfuck", "owner": "Golmote" @@ -168,7 +180,7 @@ "csharp": { "title": "C#", "require": "clike", - "alias": "dotnet", + "alias": ["cs", "dotnet"], "owner": "mvalipour" }, "cpp": { @@ -176,11 +188,20 @@ "require": "c", "owner": "zeitgeist87" }, + "cil": { + "title": "CIL", + "owner": "sbrl" + }, "coffeescript": { "title": "CoffeeScript", "require": "javascript", + "alias": "coffee", "owner": "R-osey" }, + "cmake": { + "title": "CMake", + "owner": "mjrogozinski" + }, "clojure": { "title": "Clojure", "owner": "troglotit" @@ -215,11 +236,7 @@ }, "django": { "title": "Django/Jinja2", - "require": "markup", - "peerDependencies": [ - "css", - "javascript" - ], + "require": "markup-templating", "alias": "jinja2", "owner": "romanvm" }, @@ -228,10 +245,19 @@ "alias": "dockerfile", "owner": "JustinBeckwith" }, + "ebnf": { + "title": "Extended Backus–Naur form", + "owner": "RunDevelopment" + }, "eiffel": { "title": "Eiffel", "owner": "Conaclos" }, + "ejs": { + "title": "EJS", + "require": ["javascript", "markup-templating"], + "owner": "RunDevelopment" + }, "elixir": { "title": "Elixir", "owner": "Golmote" @@ -263,6 +289,10 @@ "title": "Fortran", "owner": "Golmote" }, + "gcode": { + "title": "G-code", + "owner": "RunDevelopment" + }, "gedcom": { "title": "GEDCOM", "owner": "Golmote" @@ -323,6 +353,7 @@ }, "haskell": { "title": "Haskell", + "alias": "hs", "owner": "bholst" }, "haxe": { @@ -330,6 +361,10 @@ "require": "clike", "owner": "Golmote" }, + "hcl": { + "title": "HCL", + "owner": "outsideris" + }, "http": { "title": "HTTP", "peerDependencies": [ @@ -375,19 +410,71 @@ "require": "clike", "owner": "sherblot" }, + "javadoc": { + "title": "JavaDoc", + "require": ["markup", "java", "javadoclike"], + "peerDependencies": [ + "scala" + ], + "owner": "RunDevelopment" + }, + "javadoclike": { + "title": "JavaDoc-like", + "peerDependencies": [ + "java", + "javascript", + "php" + ], + "owner": "RunDevelopment" + }, + "javastacktrace": { + "title": "Java stack trace", + "owner": "RunDevelopment" + }, "jolie": { "title": "Jolie", "require": "clike", "owner": "thesave" }, + "jq": { + "title": "JQ", + "owner": "RunDevelopment" + }, + "jsdoc": { + "title": "JSDoc", + "require": ["javascript", "javadoclike"], + "peerDependencies": [ + "actionscript", + "coffeescript" + ], + "owner": "RunDevelopment" + }, + "js-extras": { + "title": "JS Extras", + "require": "javascript", + "peerDependencies": [ + "actionscript", + "coffeescript", + "flow", + "n4js", + "typescript" + ], + "owner": "RunDevelopment" + }, "json": { "title": "JSON", - "alias": "jsonp", - "aliasTitles": { - "jsonp": "JSONP" - }, "owner": "CupOfTea696" }, + "jsonp": { + "title": "JSONP", + "require": "json", + "owner": "RunDevelopment" + }, + "json5": { + "title": "JSON5", + "require": "json", + "owner": "RunDevelopment" + }, "julia": { "title": "Julia", "owner": "cdagnino" @@ -403,6 +490,11 @@ }, "latex": { "title": "LaTeX", + "alias": ["tex", "context"], + "aliasTitles": { + "tex": "TeX", + "context": "ConTeXt" + }, "owner": "japborst" }, "less": { @@ -438,6 +530,7 @@ "markdown": { "title": "Markdown", "require": "markup", + "alias": "md", "owner": "Golmote" }, "markup-templating": { @@ -461,12 +554,23 @@ "title": "Monkey", "owner": "Golmote" }, + "n1ql": { + "title": "N1QL", + "owner": "TMWilds" + }, "n4js": { "title": "N4JS", "require": "javascript", + "peerDependencies": [ + "jsdoc" + ], "alias": "n4jsd", "owner": "bsmith-n4" }, + "nand2tetris-hdl": { + "title": "Nand To Tetris HDL", + "owner": "stephanmax" + }, "nasm": { "title": "NASM", "owner": "rbmj" @@ -537,6 +641,11 @@ "require": ["clike", "markup-templating"], "owner": "milesj" }, + "phpdoc": { + "title": "PHPDoc", + "require": ["php", "javadoclike"], + "owner": "RunDevelopment" + }, "php-extras": { "title": "PHP Extras", "require": "php", @@ -571,20 +680,17 @@ }, "pug": { "title": "Pug", - "require": "javascript", + "require": ["markup", "javascript"], "peerDependencies": [ "coffeescript", "ejs", "handlebars", - "hogan", "less", "livescript", "markdown", - "mustache", - "plates", "scss", "stylus", - "swig" + "twig" ], "owner": "Golmote" }, @@ -597,14 +703,13 @@ "peerDependencies": [ "c", "cpp", - "fortran", - "ats", - "dsp" + "fortran" ], "owner": "Golmote" }, "python": { "title": "Python", + "alias": "py", "owner": "multipetros" }, "q": { @@ -623,6 +728,10 @@ "jsx": { "title": "React JSX", "require": ["markup", "javascript"], + "peerDependencies": [ + "jsdoc", + "js-extras" + ], "owner": "vkbansal" }, "tsx": { @@ -638,6 +747,18 @@ "require": "clike", "owner": "Golmote" }, + "regex": { + "title": "Regex", + "peerDependencies": [ + "actionscript", + "coffeescript", + "flow", + "javascript", + "typescript", + "vala" + ], + "owner": "RunDevelopment" + }, "rest": { "title": "reST (reStructuredText)", "owner": "Golmote" @@ -653,6 +774,7 @@ "ruby": { "title": "Ruby", "require": "clike", + "alias": "rb", "owner": "samflores" }, "rust": { @@ -682,6 +804,11 @@ "title": "Scheme", "owner": "bacchus123" }, + "shell-session": { + "title": "Shell session", + "require": "bash", + "owner": "RunDevelopment" + }, "smalltalk": { "title": "Smalltalk", "owner": "Golmote" @@ -724,6 +851,10 @@ "peerDependencies": "css", "owner": "Golmote" }, + "toml": { + "title": "TOML", + "owner": "RunDevelopment" + }, "tt2": { "title": "Template Toolkit 2", "require": ["clike", "markup-templating"], @@ -740,6 +871,26 @@ "alias": "ts", "owner": "vkbansal" }, + "t4-cs": { + "title": "T4 Text Templates (C#)", + "require": ["t4-templating", "csharp"], + "alias": "t4", + "owner": "RunDevelopment" + }, + "t4-vb": { + "title": "T4 Text Templates (VB)", + "require": ["t4-templating", "visual-basic"], + "owner": "RunDevelopment" + }, + "t4-templating": { + "title": "T4 templating", + "owner": "RunDevelopment" + }, + "vala": { + "title": "Vala", + "require": "clike", + "owner": "TemplarVolk" + }, "vbnet": { "title": "VB.Net", "require": "basic", @@ -796,6 +947,7 @@ }, "yaml": { "title": "YAML", + "alias": "yml", "owner": "hason" } }, @@ -809,7 +961,13 @@ "title": "Line Numbers", "owner": "kuba-kubula" }, - "show-invisibles": "Show Invisibles", + "show-invisibles": { + "title": "Show Invisibles", + "after": [ + "autolinker", + "data-uri-highlight" + ] + }, "autolinker": "Autolinker", "wpd": "WebPlatform Docs", "custom-class": { diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-abnf.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-abnf.js new file mode 100644 index 0000000000..78f3fea51e --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-abnf.js @@ -0,0 +1,57 @@ +define(["prism/prism"], function () { +(function (Prism) { + + var coreRules = '(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)'; + + Prism.languages.abnf = { + 'comment': /;.*/, + 'string': { + pattern: /(?:%[is])?"[^"\n\r]*"/, + greedy: true, + inside: { + 'punctuation': /^%[is]/ + } + }, + 'range': { + pattern: /%(?:b[01]+-[01]+|d\d+-\d+|x[A-F\d]+-[A-F\d]+)/i, + alias: 'number' + }, + 'terminal': { + pattern: /%(?:b[01]+(?:\.[01]+)*|d\d+(?:\.\d+)*|x[A-F\d]+(?:\.[A-F\d]+)*)/i, + alias: 'number' + }, + 'repetition': { + pattern: /(^|[^\w-])(?:\d*\*\d*|\d+)/, + lookbehind: true, + alias: 'operator' + }, + 'definition': { + pattern: /(^[ \t]*)(?:[a-z][\w-]*|<[^>\r\n]*>)(?=\s*=)/m, + lookbehind: true, + alias: 'keyword', + inside: { + 'punctuation': /<|>/ + } + }, + 'core-rule': { + pattern: RegExp('(?:(^|[^<\\w-])' + coreRules + '|<' + coreRules + '>)(?![\\w-])', 'i'), + lookbehind: true, + alias: ['rule', 'constant'], + inside: { + 'punctuation': /<|>/ + } + }, + 'rule': { + pattern: /(^|[^<\w-])[a-z][\w-]*|<[^>\r\n]*>/i, + lookbehind: true, + inside: { + 'punctuation': /<|>/ + } + }, + 'operator': /=\/?|\//, + 'punctuation': /[()\[\]]/ + }; + +})(Prism); + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-apacheconf.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-apacheconf.js index 20102e9362..3c4e686e0b 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-apacheconf.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-apacheconf.js @@ -2,12 +2,12 @@ define(["prism/prism"], function () { Prism.languages.apacheconf = { 'comment': /#.*/, 'directive-inline': { - pattern: /^(\s*)\b(?:AcceptFilter|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding|AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch|Allow|AllowCONNECT|AllowEncodedSlashes|AllowMethods|AllowOverride|AllowOverrideList|Anonymous|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail|AsyncRequestWorkerFactor|AuthBasicAuthoritative|AuthBasicFake|AuthBasicProvider|AuthBasicUseDigestAlgorithm|AuthDBDUserPWQuery|AuthDBDUserRealmQuery|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm|AuthDigestDomain|AuthDigestNonceLifetime|AuthDigestProvider|AuthDigestQop|AuthDigestShmemSize|AuthFormAuthoritative|AuthFormBody|AuthFormDisableNoStore|AuthFormFakeBasicAuth|AuthFormLocation|AuthFormLoginRequiredLocation|AuthFormLoginSuccessLocation|AuthFormLogoutLocation|AuthFormMethod|AuthFormMimetype|AuthFormPassword|AuthFormProvider|AuthFormSitePassphrase|AuthFormSize|AuthFormUsername|AuthGroupFile|AuthLDAPAuthorizePrefix|AuthLDAPBindAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareAsUser|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPInitialBindAsUser|AuthLDAPInitialBindPattern|AuthLDAPMaxSubGroupDepth|AuthLDAPRemoteUserAttribute|AuthLDAPRemoteUserIsDN|AuthLDAPSearchAsUser|AuthLDAPSubGroupAttribute|AuthLDAPSubGroupClass|AuthLDAPUrl|AuthMerging|AuthName|AuthnCacheContext|AuthnCacheEnable|AuthnCacheProvideFor|AuthnCacheSOCache|AuthnCacheTimeout|AuthnzFcgiCheckAuthnProvider|AuthnzFcgiDefineProvider|AuthType|AuthUserFile|AuthzDBDLoginToReferer|AuthzDBDQuery|AuthzDBDRedirectQuery|AuthzDBMType|AuthzSendForbiddenOnFailure|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferedLogs|BufferSize|CacheDefaultExpire|CacheDetailHeader|CacheDirLength|CacheDirLevels|CacheDisable|CacheEnable|CacheFile|CacheHeader|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheIgnoreQueryString|CacheIgnoreURLSessionIdentifiers|CacheKeyBaseURL|CacheLastModifiedFactor|CacheLock|CacheLockMaxAge|CacheLockPath|CacheMaxExpire|CacheMaxFileSize|CacheMinExpire|CacheMinFileSize|CacheNegotiatedDocs|CacheQuickHandler|CacheReadSize|CacheReadTime|CacheRoot|CacheSocache|CacheSocacheMaxSize|CacheSocacheMaxTime|CacheSocacheMinTime|CacheSocacheReadSize|CacheSocacheReadTime|CacheStaleOnError|CacheStoreExpired|CacheStoreNoStore|CacheStorePrivate|CGIDScriptTimeout|CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateInflateLimitRequestBody|DeflateInflateRatioBurst|DeflateInflateRatioLimit|DeflateMemLevel|DeflateWindowSize|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DTracePrivileges|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|HeartbeatAddress|HeartbeatListen|HeartbeatMaxServers|HeartbeatStorage|HeartbeatStorage|HostnameLookups|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|IndexHeadInsert|IndexIgnore|IndexIgnoreReset|IndexOptions|IndexOrderDefault|IndexStyleSheet|InputSed|ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer|KeepAlive|KeepAliveTimeout|KeptBodySize|LanguagePriority|LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionPoolTTL|LDAPConnectionTimeout|LDAPLibraryDebug|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPReferralHopLimit|LDAPReferrals|LDAPRetries|LDAPRetryDelay|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTimeout|LDAPTrustedClientCert|LDAPTrustedGlobalCert|LDAPTrustedMode|LDAPVerifyServerCert|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|LuaHookAccessChecker|LuaHookAuthChecker|LuaHookCheckUserID|LuaHookFixups|LuaHookInsertFilter|LuaHookLog|LuaHookMapToStorage|LuaHookTranslateName|LuaHookTypeChecker|LuaInherit|LuaInputFilter|LuaMapHandler|LuaOutputFilter|LuaPackageCPath|LuaPackagePath|LuaQuickHandler|LuaRoot|LuaScope|MaxConnectionsPerChild|MaxKeepAliveRequests|MaxMemFree|MaxRangeOverlaps|MaxRangeReversals|MaxRanges|MaxRequestWorkers|MaxSpareServers|MaxSpareThreads|MaxThreads|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|MMapFile|ModemStandard|ModMimeUsePathInfo|MultiviewsMatch|Mutex|NameVirtualHost|NoProxy|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|ProxyAddHeaders|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyExpressDBMFile|ProxyExpressDBMType|ProxyExpressEnable|ProxyFtpDirCharset|ProxyFtpEscapeWildcards|ProxyFtpListOnWildcard|ProxyHTMLBufSize|ProxyHTMLCharsetOut|ProxyHTMLDocType|ProxyHTMLEnable|ProxyHTMLEvents|ProxyHTMLExtended|ProxyHTMLFixups|ProxyHTMLInterp|ProxyHTMLLinks|ProxyHTMLMeta|ProxyHTMLStripComments|ProxyHTMLURLMap|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassInherit|ProxyPassInterpolateEnv|ProxyPassMatch|ProxyPassReverse|ProxyPassReverseCookieDomain|ProxyPassReverseCookiePath|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxySCGIInternalRedirect|ProxySCGISendfile|ProxySet|ProxySourceAddress|ProxyStatus|ProxyTimeout|ProxyVia|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIPHeader|RemoteIPInternalProxy|RemoteIPInternalProxyList|RemoteIPProxiesHeader|RemoteIPTrustedProxy|RemoteIPTrustedProxyList|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|RewriteBase|RewriteCond|RewriteEngine|RewriteMap|RewriteOptions|RewriteRule|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScoreBoardFile|Script|ScriptAlias|ScriptAliasMatch|ScriptInterpreterSource|ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock|SecureListen|SeeRequestTail|SendBufferSize|ServerAdmin|ServerAlias|ServerLimit|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|Session|SessionCookieName|SessionCookieName2|SessionCookieRemove|SessionCryptoCipher|SessionCryptoDriver|SessionCryptoPassphrase|SessionCryptoPassphraseFile|SessionDBDCookieName|SessionDBDCookieName2|SessionDBDCookieRemove|SessionDBDDeleteLabel|SessionDBDInsertLabel|SessionDBDPerUser|SessionDBDSelectLabel|SessionDBDUpdateLabel|SessionEnv|SessionExclude|SessionHeader|SessionInclude|SessionMaxAge|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIETag|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSLCACertificateFile|SSLCACertificatePath|SSLCADNRequestFile|SSLCADNRequestPath|SSLCARevocationCheck|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLCompression|SSLCryptoDevice|SSLEngine|SSLFIPS|SSLHonorCipherOrder|SSLInsecureRenegotiation|SSLOCSPDefaultResponder|SSLOCSPEnable|SSLOCSPOverrideResponder|SSLOCSPResponderTimeout|SSLOCSPResponseMaxAge|SSLOCSPResponseTimeSkew|SSLOCSPUseRequestNonce|SSLOpenSSLConfCmd|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationCheck|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCheckPeerCN|SSLProxyCheckPeerExpire|SSLProxyCheckPeerName|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateChainFile|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRenegBufferSize|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLSessionTicketKeyFile|SSLSRPUnknownUserSeed|SSLSRPVerifierFile|SSLStaplingCache|SSLStaplingErrorCacheTimeout|SSLStaplingFakeTryLater|SSLStaplingForceURL|SSLStaplingResponderTimeout|SSLStaplingResponseMaxAge|SSLStaplingResponseTimeSkew|SSLStaplingReturnResponderErrors|SSLStaplingStandardCacheTimeout|SSLStrictSNIVHostCheck|SSLUserName|SSLUseStapling|SSLVerifyClient|SSLVerifyDepth|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/mi, + pattern: /(^\s*)\b(?:AcceptFilter|AcceptPathInfo|AccessFileName|Action|Add(?:Alt|AltByEncoding|AltByType|Charset|DefaultCharset|Description|Encoding|Handler|Icon|IconByEncoding|IconByType|InputFilter|Language|ModuleInfo|OutputFilter|OutputFilterByType|Type)|Alias|AliasMatch|Allow(?:CONNECT|EncodedSlashes|Methods|Override|OverrideList)?|Anonymous(?:_LogEmail|_MustGiveEmail|_NoUserID|_VerifyEmail)?|AsyncRequestWorkerFactor|Auth(?:BasicAuthoritative|BasicFake|BasicProvider|BasicUseDigestAlgorithm|DBDUserPWQuery|DBDUserRealmQuery|DBMGroupFile|DBMType|DBMUserFile|Digest(?:Algorithm|Domain|NonceLifetime|Provider|Qop|ShmemSize)|Form(?:Authoritative|Body|DisableNoStore|FakeBasicAuth|Location|LoginRequiredLocation|LoginSuccessLocation|LogoutLocation|Method|Mimetype|Password|Provider|SitePassphrase|Size|Username)|GroupFile|LDAP(?:AuthorizePrefix|BindAuthoritative|BindDN|BindPassword|CharsetConfig|CompareAsUser|CompareDNOnServer|DereferenceAliases|GroupAttribute|GroupAttributeIsDN|InitialBindAsUser|InitialBindPattern|MaxSubGroupDepth|RemoteUserAttribute|RemoteUserIsDN|SearchAsUser|SubGroupAttribute|SubGroupClass|Url)|Merging|Name|Type|UserFile|nCache(?:Context|Enable|ProvideFor|SOCache|Timeout)|nzFcgiCheckAuthnProvider|nzFcgiDefineProvider|zDBDLoginToReferer|zDBDQuery|zDBDRedirectQuery|zDBMType|zSendForbiddenOnFailure)|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferSize|BufferedLogs|CGIDScriptTimeout|CGIMapExtension|Cache(?:DefaultExpire|DetailHeader|DirLength|DirLevels|Disable|Enable|File|Header|IgnoreCacheControl|IgnoreHeaders|IgnoreNoLastMod|IgnoreQueryString|IgnoreURLSessionIdentifiers|KeyBaseURL|LastModifiedFactor|Lock|LockMaxAge|LockPath|MaxExpire|MaxFileSize|MinExpire|MinFileSize|NegotiatedDocs|QuickHandler|ReadSize|ReadTime|Root|Socache(?:MaxSize|MaxTime|MinTime|ReadSize|ReadTime)?|StaleOnError|StoreExpired|StoreNoStore|StorePrivate)|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DTracePrivileges|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|Deflate(?:BufferSize|CompressionLevel|FilterNote|InflateLimitRequestBody|InflateRatio(?:Burst|Limit)|MemLevel|WindowSize)|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtFilterDefine|ExtFilterOptions|ExtendedStatus|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|Heartbeat(?:Address|Listen|MaxServers|Storage)|HostnameLookups|ISAPI(?:AppendLogToErrors|AppendLogToQuery|CacheFile|FakeAsync|LogNotSupported|ReadAheadBuffer)|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|Index(?:HeadInsert|Ignore|IgnoreReset|Options|OrderDefault|StyleSheet)|InputSed|KeepAlive|KeepAliveTimeout|KeptBodySize|LDAP(?:CacheEntries|CacheTTL|ConnectionPoolTTL|ConnectionTimeout|LibraryDebug|OpCacheEntries|OpCacheTTL|ReferralHopLimit|Referrals|Retries|RetryDelay|SharedCacheFile|SharedCacheSize|Timeout|TrustedClientCert|TrustedGlobalCert|TrustedMode|VerifyServerCert)|LanguagePriority|Limit(?:InternalRecursion|Request(?:Body|FieldSize|Fields|Line)|XMLRequestBody)|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|Lua(?:Hook(?:AccessChecker|AuthChecker|CheckUserID|Fixups|InsertFilter|Log|MapToStorage|TranslateName|TypeChecker)|Inherit|InputFilter|MapHandler|OutputFilter|PackageCPath|PackagePath|QuickHandler|Root|Scope)|MMapFile|Max(?:ConnectionsPerChild|KeepAliveRequests|MemFree|RangeOverlaps|RangeReversals|Ranges|RequestWorkers|SpareServers|SpareThreads|Threads)|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|ModMimeUsePathInfo|ModemStandard|MultiviewsMatch|Mutex|NWSSLTrustedCerts|NWSSLUpgradeable|NameVirtualHost|NoProxy|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|Proxy(?:AddHeaders|BadHeader|Block|Domain|ErrorOverride|ExpressDBMFile|ExpressDBMType|ExpressEnable|FtpDirCharset|FtpEscapeWildcards|FtpListOnWildcard|HTML(?:BufSize|CharsetOut|DocType|Enable|Events|Extended|Fixups|Interp|Links|Meta|StripComments|URLMap)|IOBufferSize|MaxForwards|Pass(?:Inherit|InterpolateEnv|Match|Reverse|ReverseCookieDomain|ReverseCookiePath)?|PreserveHost|ReceiveBufferSize|Remote|RemoteMatch|Requests|SCGIInternalRedirect|SCGISendfile|Set|SourceAddress|Status|Timeout|Via)|RLimitCPU|RLimitMEM|RLimitNPROC|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIP(?:Header|InternalProxy|InternalProxyList|ProxiesHeader|TrustedProxy|TrustedProxyList)|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|Rewrite(?:Base|Cond|Engine|Map|Options|Rule)|SSIETag|SSIEndTag|SSIErrorMsg|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSL(?:CACertificateFile|CACertificatePath|CADNRequestFile|CADNRequestPath|CARevocationCheck|CARevocationFile|CARevocationPath|CertificateChainFile|CertificateFile|CertificateKeyFile|CipherSuite|Compression|CryptoDevice|Engine|FIPS|HonorCipherOrder|InsecureRenegotiation|OCSP(?:DefaultResponder|Enable|OverrideResponder|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|UseRequestNonce)|OpenSSLConfCmd|Options|PassPhraseDialog|Protocol|Proxy(?:CACertificateFile|CACertificatePath|CARevocation(?:Check|File|Path)|CheckPeer(?:CN|Expire|Name)|CipherSuite|Engine|MachineCertificate(?:ChainFile|File|Path)|Protocol|Verify|VerifyDepth)|RandomSeed|RenegBufferSize|Require|RequireSSL|SRPUnknownUserSeed|SRPVerifierFile|Session(?:Cache|CacheTimeout|TicketKeyFile|Tickets)|Stapling(?:Cache|ErrorCacheTimeout|FakeTryLater|ForceURL|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|ReturnResponderErrors|StandardCacheTimeout)|StrictSNIVHostCheck|UseStapling|UserName|VerifyClient|VerifyDepth)|Satisfy|ScoreBoardFile|Script(?:Alias|AliasMatch|InterpreterSource|Log|LogBuffer|LogLength|Sock)?|SecureListen|SeeRequestTail|SendBufferSize|Server(?:Admin|Alias|Limit|Name|Path|Root|Signature|Tokens)|Session(?:Cookie(?:Name|Name2|Remove)|Crypto(?:Cipher|Driver|Passphrase|PassphraseFile)|DBD(?:CookieName|CookieName2|CookieRemove|DeleteLabel|InsertLabel|PerUser|SelectLabel|UpdateLabel)|Env|Exclude|Header|Include|MaxAge)?|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadStackSize|ThreadsPerChild|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|Virtual(?:DocumentRoot|ScriptAlias)(?:IP)?|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/im, lookbehind: true, alias: 'property' }, 'directive-block': { - pattern: /<\/?\b(?:AuthnProviderAlias|AuthzProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|RequireAll|RequireAny|RequireNone|VirtualHost)\b *.*>/i, + pattern: /<\/?\b(?:Auth[nz]ProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|Require(?:All|Any|None)|VirtualHost)\b *.*>/i, inside: { 'directive-block': { pattern: /^<\/?\w+/, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-asciidoc.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-asciidoc.js index 6fdf748311..f7dcc99e55 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-asciidoc.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-asciidoc.js @@ -26,7 +26,8 @@ define(["prism/prism"], function () { 'attr-value': /(?!^\s+$).+/ } }; - Prism.languages.asciidoc = { + + var asciidoc = Prism.languages.asciidoc = { 'comment-block': { pattern: /^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m, alias: 'comment' @@ -200,74 +201,37 @@ define(["prism/prism"], function () { // Allow some nesting. There is no recursion though, so cloning should not be needed. - attributes.inside['interpreted'].inside.rest = { - 'macro': Prism.languages.asciidoc['macro'], - 'inline': Prism.languages.asciidoc['inline'], - 'replacement': Prism.languages.asciidoc['replacement'], - 'entity': Prism.languages.asciidoc['entity'] - }; + function copyFromAsciiDoc(keys) { + keys = keys.split(' '); - Prism.languages.asciidoc['passthrough-block'].inside.rest = { - 'macro': Prism.languages.asciidoc['macro'] - }; + var o = {}; + for (var i = 0, l = keys.length; i < l; i++) { + o[keys[i]] = asciidoc[keys[i]]; + } + return o; + } - Prism.languages.asciidoc['literal-block'].inside.rest = { - 'callout': Prism.languages.asciidoc['callout'] - }; + attributes.inside['interpreted'].inside.rest = copyFromAsciiDoc('macro inline replacement entity'); - Prism.languages.asciidoc['table'].inside.rest = { - 'comment-block': Prism.languages.asciidoc['comment-block'], - 'passthrough-block': Prism.languages.asciidoc['passthrough-block'], - 'literal-block': Prism.languages.asciidoc['literal-block'], - 'other-block': Prism.languages.asciidoc['other-block'], - 'list-punctuation': Prism.languages.asciidoc['list-punctuation'], - 'indented-block': Prism.languages.asciidoc['indented-block'], - 'comment': Prism.languages.asciidoc['comment'], - 'title': Prism.languages.asciidoc['title'], - 'attribute-entry': Prism.languages.asciidoc['attribute-entry'], - 'attributes': Prism.languages.asciidoc['attributes'], - 'hr': Prism.languages.asciidoc['hr'], - 'page-break': Prism.languages.asciidoc['page-break'], - 'admonition': Prism.languages.asciidoc['admonition'], - 'list-label': Prism.languages.asciidoc['list-label'], - 'callout': Prism.languages.asciidoc['callout'], - 'macro': Prism.languages.asciidoc['macro'], - 'inline': Prism.languages.asciidoc['inline'], - 'replacement': Prism.languages.asciidoc['replacement'], - 'entity': Prism.languages.asciidoc['entity'], - 'line-continuation': Prism.languages.asciidoc['line-continuation'] - }; + asciidoc['passthrough-block'].inside.rest = copyFromAsciiDoc('macro'); - Prism.languages.asciidoc['other-block'].inside.rest = { - 'table': Prism.languages.asciidoc['table'], - 'list-punctuation': Prism.languages.asciidoc['list-punctuation'], - 'indented-block': Prism.languages.asciidoc['indented-block'], - 'comment': Prism.languages.asciidoc['comment'], - 'attribute-entry': Prism.languages.asciidoc['attribute-entry'], - 'attributes': Prism.languages.asciidoc['attributes'], - 'hr': Prism.languages.asciidoc['hr'], - 'page-break': Prism.languages.asciidoc['page-break'], - 'admonition': Prism.languages.asciidoc['admonition'], - 'list-label': Prism.languages.asciidoc['list-label'], - 'macro': Prism.languages.asciidoc['macro'], - 'inline': Prism.languages.asciidoc['inline'], - 'replacement': Prism.languages.asciidoc['replacement'], - 'entity': Prism.languages.asciidoc['entity'], - 'line-continuation': Prism.languages.asciidoc['line-continuation'] - }; + asciidoc['literal-block'].inside.rest = copyFromAsciiDoc('callout'); + + asciidoc['table'].inside.rest = copyFromAsciiDoc('comment-block passthrough-block literal-block other-block list-punctuation indented-block comment title attribute-entry attributes hr page-break admonition list-label callout macro inline replacement entity line-continuation'); + + asciidoc['other-block'].inside.rest = copyFromAsciiDoc('table list-punctuation indented-block comment attribute-entry attributes hr page-break admonition list-label macro inline replacement entity line-continuation'); + + asciidoc['title'].inside.rest = copyFromAsciiDoc('macro inline replacement entity'); - Prism.languages.asciidoc['title'].inside.rest = { - 'macro': Prism.languages.asciidoc['macro'], - 'inline': Prism.languages.asciidoc['inline'], - 'replacement': Prism.languages.asciidoc['replacement'], - 'entity': Prism.languages.asciidoc['entity'] - }; // Plugin to make entity title show the real entity, idea by Roman Komarov - Prism.hooks.add('wrap', function(env) { + Prism.hooks.add('wrap', function (env) { if (env.type === 'entity') { env.attributes['title'] = env.content.replace(/&/, '&'); } }); + + Prism.languages.adoc = Prism.languages.asciidoc; }(Prism)); + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-bash.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-bash.js index 2c46e4b686..d68ecde857 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-bash.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-bash.js @@ -1,86 +1,199 @@ define(["prism/prism"], function () { (function(Prism) { + // $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|' + // + LC_ALL, RANDOM, REPLY, SECONDS. + // + make sure PS1..4 are here as they are not always set, + // - some useless things. + var envVars = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b'; var insideString = { - variable: [ - // Arithmetic Environment + 'environment': { + pattern: RegExp("\\$" + envVars), + alias: 'constant' + }, + 'variable': [ + // [0]: Arithmetic Environment { pattern: /\$?\(\([\s\S]+?\)\)/, + greedy: true, inside: { // If there is a $ sign at the beginning highlight $(( and )) as variable - variable: [{ + 'variable': [ + { pattern: /(^\$\(\([\s\S]+)\)\)/, lookbehind: true }, /^\$\(\(/ ], - number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/, + 'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/, // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic - operator: /--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/, + 'operator': /--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/, // If there is no $ sign at the beginning highlight (( and )) as punctuation - punctuation: /\(\(?|\)\)?|,|;/ + 'punctuation': /\(\(?|\)\)?|,|;/ + } + }, + // [1]: Command Substitution + { + pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/, + greedy: true, + inside: { + 'variable': /^\$\(|^`|\)$|`$/ } }, - // Command Substitution + // [2]: Brace expansion { - pattern: /\$\([^)]+\)|`[^`]+`/, + pattern: /\$\{[^}]+\}/, greedy: true, inside: { - variable: /^\$\(|^`|\)$|`$/ + 'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/, + 'punctuation': /[\[\]]/, + 'environment': { + pattern: RegExp("(\\{)" + envVars), + lookbehind: true, + alias: 'constant' + } } }, - /\$(?:[\w#?*!@]+|\{[^}]+\})/i - ] + /\$(?:\w+|[#?*!@$])/ + ], + // Escape sequences from echo and printf's manuals, and escaped quotes. + 'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/ }; Prism.languages.bash = { 'shebang': { - pattern: /^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/, + pattern: /^#!\s*\/.*/, alias: 'important' }, 'comment': { - pattern: /(^|[^"{\\])#.*/, + pattern: /(^|[^"{\\$])#.*/, + lookbehind: true + }, + 'function-name': [ + // a) function foo { + // b) foo() { + // c) function foo() { + // but not “foo {” + { + // a) and c) + pattern: /(\bfunction\s+)\w+(?=(?:\s*\(?:\s*\))?\s*\{)/, + lookbehind: true, + alias: 'function' + }, + { + // b) + pattern: /\b\w+(?=\s*\(\s*\)\s*\{)/, + alias: 'function' + } + ], + // Highlight variable names as variables in for and select beginnings. + 'for-or-select': { + pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/, + alias: 'variable', + lookbehind: true + }, + // Highlight variable names as variables in the left-hand part + // of assignments (“=” and “+=”). + 'assign-left': { + pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/, + inside: { + 'environment': { + pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + envVars), + lookbehind: true, + alias: 'constant' + } + }, + alias: 'variable', lookbehind: true }, 'string': [ - //Support for Here-Documents https://en.wikipedia.org/wiki/Here_document + // Support for Here-documents https://en.wikipedia.org/wiki/Here_document { - pattern: /((?:^|[^<])<<\s*)["']?(\w+?)["']?\s*\r?\n(?:[\s\S])*?\r?\n\2/, + pattern: /((?:^|[^<])<<-?\s*)(\w+?)\s*(?:\r?\n|\r)(?:[\s\S])*?(?:\r?\n|\r)\2/, lookbehind: true, greedy: true, inside: insideString }, + // Here-document with quotes around the tag + // → No expansion (so no “inside”). + { + pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s*(?:\r?\n|\r)(?:[\s\S])*?(?:\r?\n|\r)\3/, + lookbehind: true, + greedy: true + }, + // “Normal” string { pattern: /(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\1)[^\\])*\1/, greedy: true, inside: insideString } ], + 'environment': { + pattern: RegExp("\\$?" + envVars), + alias: 'constant' + }, 'variable': insideString.variable, - // Originally based on http://ss64.com/bash/ 'function': { - pattern: /(^|[\s;|&])(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|npm|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|[\s;|&])/, + pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, lookbehind: true }, 'keyword': { - pattern: /(^|[\s;|&])(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|[\s;|&])/, + pattern: /(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/, lookbehind: true }, + // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html + 'builtin': { + pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/, + lookbehind: true, + // Alias added to make those easier to distinguish from strings. + alias: 'class-name' + }, 'boolean': { - pattern: /(^|[\s;|&])(?:true|false)(?=$|[\s;|&])/, + pattern: /(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/, lookbehind: true }, - 'operator': /&&?|\|\|?|==?|!=?|<<>|<=?|>=?|=~/, - 'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];]/ + 'file-descriptor': { + pattern: /\B&\d\b/, + alias: 'important' + }, + 'operator': { + // Lots of redirections here, but not just that. + pattern: /\d?<>|>\||\+=|==?|!=?|=~|<<[<-]?|[&\d]?>>|\d?[<>]&?|&[>&]?|\|[&|]?|<=?|>=?/, + inside: { + 'file-descriptor': { + pattern: /^\d/, + alias: 'important' + } + } + }, + 'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/, + 'number': { + pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/, + lookbehind: true + } }; + /* Patterns in command substitution. */ + var toBeCopied = [ + 'comment', + 'function-name', + 'for-or-select', + 'assign-left', + 'string', + 'environment', + 'function', + 'keyword', + 'builtin', + 'boolean', + 'file-descriptor', + 'operator', + 'punctuation', + 'number' + ]; var inside = insideString.variable[1].inside; - inside.string = Prism.languages.bash.string; - inside['function'] = Prism.languages.bash['function']; - inside.keyword = Prism.languages.bash.keyword; - inside['boolean'] = Prism.languages.bash['boolean']; - inside.operator = Prism.languages.bash.operator; - inside.punctuation = Prism.languages.bash.punctuation; - + for(var i = 0; i < toBeCopied.length; i++) { + inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]]; + } + Prism.languages.shell = Prism.languages.bash; })(Prism); diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-bnf.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-bnf.js new file mode 100644 index 0000000000..9ebb87118d --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-bnf.js @@ -0,0 +1,24 @@ +define(["prism/prism"], function () { +Prism.languages.bnf = { + 'string': { + pattern: /"[^\r\n"]*"|'[^\r\n']*'/ + }, + 'definition': { + pattern: /<[^<>\r\n\t]+>(?=\s*::=)/, + alias: ['rule', 'keyword'], + inside: { + 'punctuation': /^<|>$/ + } + }, + 'rule': { + pattern: /<[^<>\r\n\t]+>/, + inside: { + 'punctuation': /^<|>$/ + } + }, + 'operator': /::=|[|()[\]{}*+?]|\.{3}/ +}; + +Prism.languages.rbnf = Prism.languages.bnf; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-c.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-c.js index 7a540e0452..0855b32514 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-c.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-c.js @@ -1,8 +1,12 @@ define(["prism/prism","prism/components/prism-clike"], function () { Prism.languages.c = Prism.languages.extend('clike', { + 'class-name': { + pattern: /(\b(?:enum|struct)\s+)\w+/, + lookbehind: true + }, 'keyword': /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/, - 'number': /(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i + 'number': /(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i }); Prism.languages.insertBefore('c', 'string', { @@ -30,7 +34,6 @@ Prism.languages.insertBefore('c', 'string', { 'constant': /\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/ }); -delete Prism.languages.c['class-name']; delete Prism.languages.c['boolean']; return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-cil.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-cil.js new file mode 100644 index 0000000000..0456f5ab58 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-cil.js @@ -0,0 +1,30 @@ +define(["prism/prism"], function () { +Prism.languages.cil = { + 'comment': /\/\/.*/, + + 'string': { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, + + 'directive': { + pattern: /(^|\W)\.[a-z]+(?=\s)/, + lookbehind: true, + alias: 'class-name' + }, + + // Actually an assembly reference + 'variable': /\[[\w\.]+\]/, + + + 'keyword': /\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|iant|idispatch|implements|import|initonly|instance|u?int(?:8|16|32|64)?|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/, + + 'function': /\b(?:(?:constrained|unaligned|volatile|readonly|tail|no)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.[0-9]+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.[0-9]+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|ldvirtftn|castclass|beq(?:\.s)?|mkrefany|localloc|ckfinite|rethrow|ldtoken|ldsflda|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stloc|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|clt|cgt|ceq|box|and|or|br)\b/, + + 'boolean': /\b(?:true|false)\b/, + 'number': /\b-?(?:0x[0-9a-fA-F]+|[0-9]+)(?:\.[0-9a-fA-F]+)?\b/i, + + 'punctuation': /[{}[\];(),:=]|IL_[0-9A-Za-z]+/ +} + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-cmake.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-cmake.js new file mode 100644 index 0000000000..f64b954db6 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-cmake.js @@ -0,0 +1,32 @@ +define(["prism/prism"], function () { +Prism.languages.cmake = { + 'comment': /#.*/, + 'string': { + pattern: /"(?:[^\\"]|\\.)*"/, + greedy: true, + inside: { + 'interpolation': { + pattern: /\${(?:[^{}$]|\${[^{}$]*})*}/, + inside: { + 'punctuation': /\${|}/, + 'variable': /\w+/ + } + } + } + }, + 'variable': /\b(?:CMAKE_\w+|\w+_(?:VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?|(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT)|(?:CTEST_CUSTOM_(?:MAXIMUM_(?:(?:FAIL|PASS)ED_TEST_OUTPUT_SIZE|NUMBER_OF_(?:ERROR|WARNING)S)|ERROR_(?:P(?:OST|RE)_CONTEXT|EXCEPTION|MATCH)|P(?:OST|RE)_MEMCHECK|WARNING_(?:EXCEPTION|MATCH)|(?:MEMCHECK|TESTS)_IGNORE|P(?:OST|RE)_TEST|COVERAGE_EXCLUDE)|ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_(?:BINARY_DIR|DESCRIPTION|HOMEPAGE_URL|NAME|SOURCE_DIR|VERSION|VERSION_(?:MAJOR|MINOR|PATCH|TWEAK))|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE|XCODE_VERSION))\b/, + 'property': /\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ARCHIVE_OUTPUT_NAME|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEBUG_POSTFIX|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|GLOBAL_KEYWORD|GLOBAL_PROJECT_TYPES|GLOBAL_ROOTNAMESPACE|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/, + 'keyword': /\b(?:add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|break|build_command|build_name|cmake_host_system_information|cmake_minimum_required|cmake_parse_arguments|cmake_policy|configure_file|continue|create_test_sourcelist|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload|define_property|else|elseif|enable_language|enable_testing|endforeach|endfunction|endif|endmacro|endwhile|exec_program|execute_process|export|export_library_dependencies|file|find_file|find_library|find_package|find_path|find_program|fltk_wrap_ui|foreach|function|get_cmake_property|get_directory_property|get_filename_component|get_property|get_source_file_property|get_target_property|get_test_property|if|include|include_directories|include_external_msproject|include_guard|include_regular_expression|install|install_files|install_programs|install_targets|link_directories|link_libraries|list|load_cache|load_command|macro|make_directory|mark_as_advanced|math|message|option|output_required_files|project|qt_wrap_cpp|qt_wrap_ui|remove|remove_definitions|return|separate_arguments|set|set_directory_properties|set_property|set_source_files_properties|set_target_properties|set_tests_properties|site_name|source_group|string|subdir_depends|subdirs|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_sources|try_compile|try_run|unset|use_mangled_mesa|utility_source|variable_requires|variable_watch|while|write_file)(?=\s*\()\b/, + 'boolean': /\b(?:ON|OFF|TRUE|FALSE)\b/, + 'namespace': /\b(?:PROPERTIES|SHARED|PRIVATE|STATIC|PUBLIC|INTERFACE|TARGET_OBJECTS)\b/, + 'operator': /\b(?:NOT|AND|OR|MATCHES|LESS|GREATER|EQUAL|STRLESS|STRGREATER|STREQUAL|VERSION_LESS|VERSION_EQUAL|VERSION_GREATER|DEFINED)\b/, + 'inserted': { + pattern: /\b\w+::\w+\b/, + alias: 'class-name' + }, + 'number': /\b\d+(?:\.\d+)*\b/, + 'function': /\b[a-z_]\w*(?=\s*\()\b/i, + 'punctuation': /[()>}]|\$[<{]/ +}; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-coffeescript.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-coffeescript.js index f80cf8ad0e..b0e66c7859 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-coffeescript.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-coffeescript.js @@ -89,5 +89,6 @@ Prism.languages.insertBefore('coffeescript', 'keyword', { delete Prism.languages.coffeescript['template-string']; +Prism.languages.coffee = Prism.languages.coffeescript; }(Prism)); return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-cpp.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-cpp.js index 611ff8f45d..278a7892c9 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-cpp.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-cpp.js @@ -1,15 +1,16 @@ define(["prism/prism","prism/components/prism-c"], function () { Prism.languages.cpp = Prism.languages.extend('c', { - 'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, - 'boolean': /\b(?:true|false)\b/, - 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/ -}); - -Prism.languages.insertBefore('cpp', 'keyword', { 'class-name': { - pattern: /(class\s+)\w+/i, + pattern: /(\b(?:class|enum|struct)\s+)\w+/, lookbehind: true - } + }, + 'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, + 'number': { + pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i, + greedy: true + }, + 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, + 'boolean': /\b(?:true|false)\b/ }); Prism.languages.insertBefore('cpp', 'string', { diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-csharp.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-csharp.js index ebdb34d0a1..6bc59dd760 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-csharp.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-csharp.js @@ -44,7 +44,9 @@ Prism.languages.csharp = Prism.languages.extend('clike', { } } ], - 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)f?/i + 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)f?/i, + 'operator': />>=?|<<=?|[-=]>|([-+&|?])\1|~|[-+*/%&|^!=<>]=?/, + 'punctuation': /\?\.?|::|[{}[\];(),.:]/ }); Prism.languages.insertBefore('csharp', 'class-name', { @@ -77,5 +79,6 @@ Prism.languages.insertBefore('csharp', 'class-name', { } }); -Prism.languages.dotnet = Prism.languages.csharp; +Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-css-extras.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-css-extras.js index f322469619..5a0bbfa505 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-css-extras.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-css-extras.js @@ -1,18 +1,79 @@ define(["prism/prism","prism/components/prism-css"], function () { Prism.languages.css.selector = { - pattern: /[^{}\s][^{}]*(?=\s*\{)/, + pattern: Prism.languages.css.selector, inside: { 'pseudo-element': /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/, - 'pseudo-class': /:[-\w]+(?:\(.*\))?/, + 'pseudo-class': /:[-\w]+/, 'class': /\.[-:.\w]+/, 'id': /#[-:.\w]+/, - 'attribute': /\[[^\]]+\]/ + 'attribute': { + pattern: /\[(?:[^[\]"']|("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1)*\]/, + greedy: true, + inside: { + 'punctuation': /^\[|\]$/, + 'case-sensitivity': { + pattern: /(\s)[si]$/i, + lookbehind: true, + alias: 'keyword' + }, + 'namespace': { + pattern: /^(\s*)[-*\w\xA0-\uFFFF]*\|(?!=)/, + lookbehind: true, + inside: { + 'punctuation': /\|$/ + } + }, + 'attribute': { + pattern: /^(\s*)[-\w\xA0-\uFFFF]+/, + lookbehind: true + }, + 'value': [ + /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + { + pattern: /(=\s*)[-\w\xA0-\uFFFF]+(?=\s*$)/, + lookbehind: true + } + ], + 'operator': /[|~*^$]?=/ + } + }, + 'n-th': [ + { + pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/, + lookbehind: true, + inside: { + 'number': /[\dn]+/, + 'operator': /[+-]/ + } + }, + { + pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i, + lookbehind: true + } + ], + 'punctuation': /[()]/ } }; +Prism.languages.insertBefore('css', 'property', { + 'variable': { + pattern: /(^|[^-\w\xA0-\uFFFF])--[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*/i, + lookbehind: true + } +}); + Prism.languages.insertBefore('css', 'function', { + 'operator': { + pattern: /(\s)[+\-*\/](?=\s)/, + lookbehind: true + }, 'hexcode': /#[\da-f]{3,8}/i, 'entity': /\\[\da-f]{1,8}/i, - 'number': /[\d%.]+/ + 'unit': { + pattern: /(\d)(?:%|[a-z]+)/, + lookbehind: true + }, + 'number': /-?[\d.]+/ }); + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-css.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-css.js index 6afd33248d..aee107620f 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-css.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-css.js @@ -1,54 +1,60 @@ define(["prism/prism","prism/components/prism-markup"], function () { -Prism.languages.css = { - 'comment': /\/\*[\s\S]*?\*\//, - 'atrule': { - pattern: /@[\w-]+?.*?(?:;|(?=\s*\{))/i, - inside: { - 'rule': /@[\w-]+/ - // See rest below - } - }, - 'url': /url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, - 'selector': /[^{}\s][^{};]*?(?=\s*\{)/, - 'string': { - pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, - greedy: true - }, - 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i, - 'important': /\B!important\b/i, - 'function': /[-a-z0-9]+(?=\()/i, - 'punctuation': /[(){};:]/ -}; +(function (Prism) { -Prism.languages.css['atrule'].inside.rest = Prism.languages.css; + var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/; -if (Prism.languages.markup) { - Prism.languages.insertBefore('markup', 'tag', { - 'style': { - pattern: /()[\s\S]*?(?=<\/style>)/i, - lookbehind: true, - inside: Prism.languages.css, - alias: 'language-css', + Prism.languages.css = { + 'comment': /\/\*[\s\S]*?\*\//, + 'atrule': { + pattern: /@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/, + inside: { + 'rule': /@[\w-]+/ + // See rest below + } + }, + 'url': { + pattern: RegExp('url\\((?:' + string.source + '|[^\n\r()]*)\\)', 'i'), + inside: { + 'function': /^url/i, + 'punctuation': /^\(|\)$/ + } + }, + 'selector': RegExp('[^{}\\s](?:[^{};"\']|' + string.source + ')*?(?=\\s*\\{)'), + 'string': { + pattern: string, greedy: true - } - }); + }, + 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i, + 'important': /!important\b/i, + 'function': /[-a-z0-9]+(?=\()/i, + 'punctuation': /[(){};:,]/ + }; - Prism.languages.insertBefore('inside', 'attr-value', { - 'style-attr': { - pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, - inside: { - 'attr-name': { - pattern: /^\s*style/i, - inside: Prism.languages.markup.tag.inside + Prism.languages.css['atrule'].inside.rest = Prism.languages.css; + + var markup = Prism.languages.markup; + if (markup) { + markup.tag.addInlined('style', 'css'); + + Prism.languages.insertBefore('inside', 'attr-value', { + 'style-attr': { + pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, + inside: { + 'attr-name': { + pattern: /^\s*style/i, + inside: markup.tag.inside + }, + 'punctuation': /^\s*=\s*['"]|['"]\s*$/, + 'attr-value': { + pattern: /.+/i, + inside: Prism.languages.css + } }, - 'punctuation': /^\s*=\s*['"]|['"]\s*$/, - 'attr-value': { - pattern: /.+/i, - inside: Prism.languages.css - } - }, - alias: 'language-css' - } - }, Prism.languages.markup.tag); -} + alias: 'language-css' + } + }, markup.tag); + } + +}(Prism)); + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-django.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-django.js index 79c6ee0759..85472a833a 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-django.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-django.js @@ -1,44 +1,63 @@ -define(["prism/prism","prism/components/prism-markup","prism/components/prism-css","prism/components/prism-javascript"], function () { +define(["prism/prism","prism/components/prism-markup-templating"], function () { // Django/Jinja2 syntax definition for Prism.js syntax highlighter. // Mostly it works OK but can paint code incorrectly on complex html/template tag combinations. -var _django_template = { - 'property': { - pattern: /(?:{{|{%)[\s\S]*?(?:%}|}})/g, - greedy: true, - inside: { - 'string': { - pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, - greedy: true - }, - 'keyword': /\b(?:\||load|verbatim|widthratio|ssi|firstof|for|url|ifchanged|csrf_token|lorem|ifnotequal|autoescape|now|templatetag|debug|cycle|ifequal|regroup|comment|filter|endfilter|if|spaceless|with|extends|block|include|else|empty|endif|endfor|as|endblock|endautoescape|endverbatim|trans|endtrans|[Tt]rue|[Ff]alse|[Nn]one|in|is|static|macro|endmacro|call|endcall|set|endset|raw|endraw)\b/, - 'operator' : /[-+=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/, - 'function': /\b(?:_|abs|add|addslashes|attr|batch|callable|capfirst|capitalize|center|count|cut|d|date|default|default_if_none|defined|dictsort|dictsortreversed|divisibleby|e|equalto|escape|escaped|escapejs|even|filesizeformat|first|float|floatformat|force_escape|forceescape|format|get_digit|groupby|indent|int|iriencode|iterable|join|last|length|length_is|linebreaks|linebreaksbr|linenumbers|list|ljust|lower|make_list|map|mapping|number|odd|phone2numeric|pluralize|pprint|random|reject|rejectattr|removetags|replace|reverse|rjust|round|safe|safeseq|sameas|select|selectattr|sequence|slice|slugify|sort|string|stringformat|striptags|sum|time|timesince|timeuntil|title|trim|truncate|truncatechars|truncatechars_html|truncatewords|truncatewords_html|undefined|unordered_list|upper|urlencode|urlize|urlizetrunc|wordcount|wordwrap|xmlattr|yesno)\b/, - 'important': /\b-?\d+(?:\.\d+)?\b/, - 'variable': /\b\w+?\b/, - 'punctuation' : /[[\];(),.:]/ - } - } -}; - -Prism.languages.django = Prism.languages.extend('markup', {'comment': /(?:)/}); -// Updated html tag pattern to allow template tags inside html tags -Prism.languages.django.tag.pattern = /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^>=]+))?)*\s*\/?>/i; -Prism.languages.insertBefore('django', 'entity', _django_template); -Prism.languages.insertBefore('inside', 'tag', _django_template, Prism.languages.django.tag); - -if (Prism.languages.javascript) { - // Combine js code and template tags painting inside