From a1c96bff9d50a78c436203124a29da1e85cc169a Mon Sep 17 00:00:00 2001 From: Samuel Flores Date: Tue, 31 Jul 2012 22:09:13 -0300 Subject: [PATCH 1/2] Added Support to Ruby Language --- prism-dark.css | 12 ++++++++---- prism-funky.css | 10 +++++++--- prism.css | 12 ++++++++---- prism.js | 21 ++++++++++++++++++++- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/prism-dark.css b/prism-dark.css index 44b7b730d2..cc3fc1eee8 100644 --- a/prism-dark.css +++ b/prism-dark.css @@ -13,11 +13,11 @@ pre[class*="language-"] { text-align: left; white-space: pre; word-spacing: normal; - + -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; - + -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; @@ -33,7 +33,7 @@ pre[class*="language-"], pre[class*="language-"] { padding: 1em; margin: .5em 0; - overflow: auto; + overflow: auto; border: .3em solid hsl(30,20%,40%); border-radius: .5em; box-shadow: 1px 1px .5em black inset; @@ -63,6 +63,8 @@ pre[class*="language-"] { } .token.property, +.token.const, +.token.symbol, .token.tag, .token.boolean, .token.number { @@ -70,12 +72,14 @@ pre[class*="language-"] { } .token.selector, +.token.builtin, .token.attr-name, .token.string { color: hsl(75, 70%, 60%); } .token.operator, +.token.inst-var, .token.entity, .token.url, .language-css .token.string, @@ -101,4 +105,4 @@ pre[class*="language-"] { .token.entity { cursor: help; -} \ No newline at end of file +} diff --git a/prism-funky.css b/prism-funky.css index ba31709c94..a7e8c5dcc0 100644 --- a/prism-funky.css +++ b/prism-funky.css @@ -11,11 +11,11 @@ pre[class*="language-"] { text-align: left; white-space: pre; word-spacing: normal; - + -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; - + -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; @@ -60,6 +60,8 @@ code[class*="language-"] { } .token.property, +.token.const, +.token.symbol, .token.tag, .token.boolean, .token.number { @@ -67,12 +69,14 @@ code[class*="language-"] { } .token.selector, +.token.builtin, .token.attr-name, .token.string { color: yellow; } .token.operator, +.token.inst-var, .token.entity, .token.url, .language-css .token.string { @@ -97,4 +101,4 @@ code[class*="language-"] { .token.entity { cursor: help; -} \ No newline at end of file +} diff --git a/prism.css b/prism.css index a74df7e0c6..1630a592c8 100644 --- a/prism.css +++ b/prism.css @@ -13,11 +13,11 @@ pre[class*="language-"] { text-align: left; white-space: pre; word-spacing: normal; - + -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; - + -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; @@ -28,7 +28,7 @@ pre[class*="language-"] { pre[class*="language-"] { padding: 1em; margin: .5em 0; - overflow: auto; + overflow: auto; } :not(pre) > code[class*="language-"], @@ -58,6 +58,8 @@ pre[class*="language-"] { } .token.property, +.token.const, +.token.symbol, .token.tag, .token.boolean, .token.number { @@ -65,12 +67,14 @@ pre[class*="language-"] { } .token.selector, +.token.builtin, .token.attr-name, .token.string { color: #690; } .token.operator, +.token.inst-var, .token.entity, .token.url, .language-css .token.string, @@ -97,4 +101,4 @@ pre[class*="language-"] { .token.entity { cursor: help; -} \ No newline at end of file +} diff --git a/prism.js b/prism.js index b52f1461c5..6e4033e2d7 100644 --- a/prism.js +++ b/prism.js @@ -412,6 +412,25 @@ Prism.languages.javascript = { 'punctuation': /[{}[\];(),.:]/g }; +Prism.languages.ruby = { + 'comment': /#[^\r\n]*(\r?\n|$)/g, + 'string': /("|')(\\?.)*?\1/g, + 'regex': { + pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g, + lookbehind: true + }, + 'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/g, + 'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, + 'boolean': /\b(true|false)\b/g, + 'number': /\b-?(0x)?\d*\.?\d+\b/g, + 'operator': /[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, + 'inst-var': /[@&]\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, + 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, + 'const': /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/g, + 'ignore': /&(lt|gt|amp);/gi, + 'punctuation': /[{}[\];(),.:]/g +}; + if (Prism.languages.markup) { Prism.languages.insertBefore('markup', 'tag', { 'script': { @@ -425,4 +444,4 @@ if (Prism.languages.markup) { } } }); -} \ No newline at end of file +} From a202d08f5ec0a416d274b232c414e216784c6287 Mon Sep 17 00:00:00 2001 From: Samuel Flores Date: Tue, 31 Jul 2012 22:12:42 -0300 Subject: [PATCH 2/2] Added support to VIM language --- prism.js | 174 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 92 insertions(+), 82 deletions(-) diff --git a/prism.js b/prism.js index 6e4033e2d7..4d9a6966b1 100644 --- a/prism.js +++ b/prism.js @@ -1,8 +1,8 @@ -/*********************************************** - Begin prism-core.js -***********************************************/ +/*********************************************** + Begin prism-core.js +***********************************************/ /** * Prism: Lightweight, robust, elegant syntax highlighting @@ -21,32 +21,32 @@ var _ = self.Prism = { root = root || _.languages; var grammar = root[inside]; var ret = {}; - + for (var token in grammar) { - + if (grammar.hasOwnProperty(token)) { - + if (token == before) { - + for (var newToken in insert) { - + if (insert.hasOwnProperty(newToken)) { ret[newToken] = insert[newToken]; } } } - + ret[token] = grammar[token]; } } - + return root[inside] = ret; }, - + DFS: function(o, callback) { for (var i in o) { callback.call(o, i, o[i]); - + if (Object.prototype.toString.call(o) === '[object Object]') { _.languages.DFS(o[i], callback); } @@ -61,15 +61,15 @@ var _ = self.Prism = { _.highlightElement(element, async === true, callback); } }, - + highlightElement: function(element, async, callback) { // Find language var language, grammar, parent = element; - + while (parent && !lang.test(parent.className)) { parent = parent.parentNode; } - + if (parent) { language = (parent.className.match(lang) || [,''])[1]; grammar = _.languages[language]; @@ -78,48 +78,48 @@ var _ = self.Prism = { if (!grammar) { return; } - + // Set language on the element, if not present element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; - + // Set language on the parent, for styling parent = element.parentNode; - + if (/pre/i.test(parent.nodeName)) { - parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; + parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; } var code = element.textContent.trim(); - + if(!code) { return; } - + code = code.replace(/&/g, '&').replace(//g, '>').replace(/\u00a0/g, ' '); //console.time(code.slice(0,50)); - + var env = { element: element, language: language, grammar: grammar, code: code }; - + _.hooks.run('before-highlight', env); - + if (async && self.Worker) { - var worker = new Worker(_.filename); - + var worker = new Worker(_.filename); + worker.onmessage = function(evt) { env.highlightedCode = Token.stringify(JSON.parse(evt.data)); env.element.innerHTML = env.highlightedCode; - + callback && callback.call(env.element); //console.timeEnd(code.slice(0,50)); _.hooks.run('after-highlight', env); }; - + worker.postMessage(JSON.stringify({ language: env.language, code: env.code @@ -128,61 +128,61 @@ var _ = self.Prism = { else { env.highlightedCode = _.highlight(env.code, env.grammar) env.element.innerHTML = env.highlightedCode; - + callback && callback.call(element); - + _.hooks.run('after-highlight', env); //console.timeEnd(code.slice(0,50)); } }, - + highlight: function (text, grammar) { return Token.stringify(_.tokenize(text, grammar)); }, - + tokenize: function(text, grammar) { var Token = _.Token; - + var strarr = [text]; - + var rest = grammar.rest; - + if (rest) { for (var token in rest) { grammar[token] = rest[token]; } - + delete grammar.rest; } - + tokenloop: for (var token in grammar) { if(!grammar.hasOwnProperty(token) || !grammar[token]) { continue; } - - var pattern = grammar[token], + + var pattern = grammar[token], inside = pattern.inside, lookbehind = !!pattern.lookbehind || 0; - + pattern = pattern.pattern || pattern; - + for (var i=0; i text.length) { // Something went terribly wrong, ABORT, ABORT! break tokenloop; } - + if (str instanceof Token) { continue; } - + pattern.lastIndex = 0; - + var match = pattern.exec(str); - + if (match) { if(lookbehind) { lookbehind = match[1].length; @@ -193,22 +193,22 @@ var _ = self.Prism = { len = match.length, to = from + len, before = str.slice(0, from + 1), - after = str.slice(to + 1); + after = str.slice(to + 1); var args = [i, 1]; - + if (before) { args.push(before); } - + var wrapped = new Token(token, inside? _.tokenize(match, inside) : match); - + args.push(wrapped); - + if (after) { args.push(after); } - + Array.prototype.splice.apply(strarr, args); } } @@ -216,25 +216,25 @@ var _ = self.Prism = { return strarr; }, - + hooks: { all: {}, - + add: function (name, callback) { var hooks = _.hooks.all; - + hooks[name] = hooks[name] || []; - + hooks[name].push(callback); }, - + run: function (name, env) { var callbacks = _.hooks.all[name]; - + if (!callbacks || !callbacks.length) { return; } - + for (var i=0, callback; callback = callbacks[i++];) { callback(env); } @@ -251,15 +251,15 @@ Token.stringify = function(o) { if (typeof o == 'string') { return o; } - + if (Object.prototype.toString.call(o) == '[object Array]') { for (var i=0; i' + env.content + ''; - + }; if (!self.document) { @@ -290,11 +290,11 @@ if (!self.document) { var message = JSON.parse(evt.data), lang = message.language, code = message.code; - + self.postMessage(JSON.stringify(_.tokenize(code, _.languages[lang]))); self.close(); }, false); - + return; } @@ -305,7 +305,7 @@ script = script[script.length - 1]; if (script) { _.filename = script.src; - + if (document.addEventListener && !script.hasAttribute('data-manual')) { document.addEventListener('DOMContentLoaded', _.highlightAll); } @@ -313,9 +313,9 @@ if (script) { })(); -/*********************************************** - Begin prism-markup.js -***********************************************/ +/*********************************************** + Begin prism-markup.js +***********************************************/ Prism.languages.markup = { 'comment': /<!--[\w\W]*?--(>|>)/g, @@ -345,7 +345,7 @@ Prism.languages.markup = { 'namespace': /^[\w-]+?:/ } } - + } }, 'entity': /&#?[\da-z]{1,8};/gi @@ -359,9 +359,9 @@ Prism.hooks.add('wrap', function(env) { } }); -/*********************************************** - Begin prism-css.js -***********************************************/ +/*********************************************** + Begin prism-css.js +***********************************************/ Prism.languages.css = { 'comment': /\/\*[\w\W]*?\*\//g, @@ -390,9 +390,9 @@ if (Prism.languages.markup) { }); } -/*********************************************** - Begin prism-javascript.js -***********************************************/ +/*********************************************** + Begin prism-javascript.js +***********************************************/ Prism.languages.javascript = { 'comment': { @@ -431,6 +431,16 @@ Prism.languages.ruby = { 'punctuation': /[{}[\];(),.:]/g }; +Prism.languages.vim = { + 'string': /("|')(\\?.)*?\1/g, + 'comment': /("+[^"\r\n]*|^".*)(\r?\n|$)/g, + 'keyword': /\b(ab|abbreviate|abc|abclear|abo|aboveleft|al|all|arga|argadd|argd|argdelete|argdo|arge|argedit|argg|argglobal|argl|arglocal|ar|args|argu|argument|as|ascii|bad|badd|ba|ball|bd|bdelete|be|bel|belowright|bf|bfirst|bl|blast|bm|bmodified|bn|bnext|bN|bNext|bo|botright|bp|bprevious|brea|break|breaka|breakadd|breakd|breakdel|breakl|breaklist|br|brewind|bro|browse|bufdo|b|buffer|buffers|bun|bunload|bw|bwipeout|ca|cabbrev|cabc|cabclear|caddb|caddbuffer|cad|caddexpr|caddf|caddfile|cal|call|cat|catch|cb|cbuffer|cc|ccl|cclose|cd|ce|center|cex|cexpr|cf|cfile|cfir|cfirst|cgetb|cgetbuffer|cgete|cgetexpr|cg|cgetfile|c|change|changes|chd|chdir|che|checkpath|checkt|checktime|cla|clast|cl|clist|clo|close|cmapc|cmapclear|cnew|cnewer|cn|cnext|cN|cNext|cnf|cnfile|cNfcNfile|cnorea|cnoreabbrev|col|colder|colo|colorscheme|comc|comclear|comp|compiler|conf|confirm|con|continue|cope|copen|co|copy|cpf|cpfile|cp|cprevious|cq|cquit|cr|crewind|cuna|cunabbrev|cu|cunmap|cw|cwindow|debugg|debuggreedy|delc|delcommand|d|delete|delf|delfunction|delm|delmarks|diffg|diffget|diffoff|diffpatch|diffpu|diffput|diffsplit|diffthis|diffu|diffupdate|dig|digraphs|di|display|dj|djump|dl|dlist|dr|drop|ds|dsearch|dsp|dsplit|earlier|echoe|echoerr|echom|echomsg|echon|e|edit|el|else|elsei|elseif|em|emenu|emenu*|endfo|endfor|endf|endfunction|endfun|en|endif|endt|endtry|endw|endwhile|ene|enew|ex|exi|exit|exu|exusage|f|file|files|filetype|fina|finally|fin|find|fini|finish|fir|first|fix|fixdel|fo|fold|foldc|foldclose|folddoc|folddoclosed|foldd|folddoopen|foldo|foldopen|for|fu|fun|function|go|goto|gr|grep|grepa|grepadd|ha|hardcopy|h|help|helpf|helpfind|helpg|helpgrep|helpt|helptags|hid|hide|his|history|ia|iabbrev|iabc|iabclear|if|ij|ijump|il|ilist|imapc|imapclear|inorea|inoreabbrev|is|isearch|isp|isplit|iuna|iunabbrev|iu|iunmap|j|join|ju|jumps|k|keepalt|keepj|keepjumps|kee|keepmarks|laddb|laddbuffer|lad|laddexpr|laddf|laddfile|lan|language|la|last|later|lb|lbuffer|lc|lcd|lch|lchdir|lcl|lclose|let|left|lefta|leftabove|lex|lexpr|lf|lfile|lfir|lfirst|lgetb|lgetbuffer|lgete|lgetexpr|lg|lgetfile|lgr|lgrep|lgrepa|lgrepadd|lh|lhelpgrep|l|list|ll|lla|llast|lli|llist|lmak|lmake|lm|lmap|lmapc|lmapclear|lnew|lnewer|lne|lnext|lN|lNext|lnf|lnfile|lNf|lNfile|ln|lnoremap|lo|loadview|loc|lockmarks|lockv|lockvar|lol|lolder|lop|lopen|lpf|lpfile|lp|lprevious|lr|lrewind|ls|lt|ltag|lu|lunmap|lv|lvimgrep|lvimgrepa|lvimgrepadd|lw|lwindow|mak|make|ma|mark|marks|mat|match|menut|menutranslate|mk|mkexrc|mks|mksession|mksp|mkspell|mkvie|mkview|mkv|mkvimrc|mod|mode|m|move|mzf|mzfile|mz|mzscheme|nbkey|new|n|next|N|Next|nmapc|nmapclear|noh|nohlsearch|norea|noreabbrev|nu|number|nun|nunmap|omapc|omapclear|on|only|o|open|opt|options|ou|ounmap|pc|pclose|ped|pedit|pe|perl|perld|perldo|po|pop|popu|popu|popup|pp|ppop|pre|preserve|prev|previous|p|print|P|Print|profd|profdel|prof|profile|promptf|promptfind|promptr|promptrepl|ps|psearch|pta|ptag|ptf|ptfirst|ptj|ptjump|ptl|ptlast|ptn|ptnext|ptN|ptNext|ptp|ptprevious|ptr|ptrewind|pts|ptselect|pu|put|pw|pwd|pyf|pyfile|py|python|qa|qall|q|quit|quita|quitall|r|read|rec|recover|redi|redir|red|redo|redr|redraw|redraws|redrawstatus|reg|registers|res|resize|ret|retab|retu|return|rew|rewind|ri|right|rightb|rightbelow|rub|ruby|rubyd|rubydo|rubyf|rubyfile|ru|runtime|rv|rviminfo|sal|sall|san|sandbox|sa|sargument|sav|saveas|sba|sball|sbf|sbfirst|sbl|sblast|sbm|sbmodified|sbn|sbnext|sbN|sbNext|sbp|sbprevious|sbr|sbrewind|sb|sbuffer|scripte|scriptencoding|scrip|scriptnames|se|set|setf|setfiletype|setg|setglobal|setl|setlocal|sf|sfind|sfir|sfirst|sh|shell|sign|sil|silent|sim|simalt|sla|slast|sl|sleep|sm|smagic|sm|smap|smapc|smapclear|sme|smenu|sn|snext|sN|sNext|sni|sniff|sno|snomagic|snor|snoremap|snoreme|snoremenu|sor|sort|so|source|spelld|spelldump|spe|spellgood|spelli|spellinfo|spellr|spellrepall|spellu|spellundo|spellw|spellwrong|sp|split|spr|sprevious|sre|srewind|sta|stag|startg|startgreplace|star|startinsert|startr|startreplace|stj|stjump|st|stop|stopi|stopinsert|sts|stselect|sun|sunhide|sunm|sunmap|sus|suspend|sv|sview|syncbind|t|tab|tabc|tabclose|tabd|tabdo|tabe|tabedit|tabf|tabfind|tabfir|tabfirst|tabl|tablast|tabm|tabmove|tabnew|tabn|tabnext|tabN|tabNext|tabo|tabonly|tabp|tabprevious|tabr|tabrewind|tabs|ta|tag|tags|tc|tcl|tcld|tcldo|tclf|tclfile|te|tearoff|tf|tfirst|th|throw|tj|tjump|tl|tlast|tm|tm|tmenu|tn|tnext|tN|tNext|to|topleft|tp|tprevious|tr|trewind|try|ts|tselect|tu|tu|tunmenu|una|unabbreviate|u|undo|undoj|undojoin|undol|undolist|unh|unhide|unlo|unlockvar|unm|unmap|up|update|verb|verbose|ve|version|vert|vertical|vie|view|vim|vimgrep|vimgrepa|vimgrepadd|vi|visual|viu|viusage|vmapc|vmapclear|vne|vnew|vs|vsplit|vu|vunmap|wa|wall|wh|while|winc|wincmd|windo|winp|winpos|win|winsize|wn|wnext|wN|wNext|wp|wprevious|wq|wqa|wqall|w|write|ws|wsverb|wv|wviminfo|X|xa|xall|x|xit|xm|xmap|xmapc|xmapclear|xme|xmenu|XMLent|XMLns|xn|xnoremap|xnoreme|xnoremenu|xu|xunmap|y|yank)\b/g, + 'builtin': /\b(autocmd|acd|ai|akm|al|aleph|allowrevins|altkeymap|ambiwidth|ambw|anti|antialias|ar|arab|arabic|arabicshape|ari|arshape|autochdir|autoindent|autoread|autowrite|autowriteall|aw|awa|background|backspace|backup|backupcopy|backupdir|backupext|backupskip|balloondelay|ballooneval|balloonexpr|bdir|bdlay|beval|bex|bexpr|bg|bh|bin|binary|biosk|bioskey|bk|bkc|bl|bomb|breakat|brk|browsedir|bs|bsdir|bsk|bt|bufhidden|buflisted|buftype|casemap|cb|ccv|cd|cdpath|cedit|cf|cfu|ch|charconvert|ci|cin|cindent|cink|cinkeys|cino|cinoptions|cinw|cinwords|clipboard|cmdheight|cmdwinheight|cmp|cms|co|columns|com|comments|commentstring|compatible|complete|completefunc|completeopt|confirm|consk|conskey|copyindent|cot|cp|cpo|cpoptions|cpt|cscopepathcomp|cscopeprg|cscopequickfix|cscopetag|cscopetagorder|cscopeverbose|cspc|csprg|csqf|cst|csto|csverb|cuc|cul|cursorcolumn|cursorline|cwh|debug|deco|def|define|delcombine|dex|dg|dict|dictionary|diff|diffexpr|diffopt|digraph|dip|dir|directory|display|dy|ea|ead|eadirection|eb|ed|edcompatible|ef|efm|ei|ek|enc|encoding|endofline|eol|ep|equalalways|equalprg|errorbells|errorfile|errorformat|esckeys|et|eventignore|ex|expandtab|exrc|fcl|fcs|fdc|fde|fdi|fdl|fdls|fdm|fdn|fdo|fdt|fen|fenc|fencs|fex|ff|ffs|fileencoding|fileencodings|fileformat|fileformats|fillchars|fk|fkmap|flp|fml|fmr|fo|foldclose|foldcolumn|foldenable|foldexpr|foldignore|foldlevel|foldlevelstart|foldmarker|foldmethod|foldminlines|foldnestmax|foldopen|foldtext|formatexpr|formatlistpat|formatoptions|formatprg|fp|fs|fsync|ft|gcr|gd|gdefault|gfm|gfn|gfs|gfw|ghr|go|gp|grepformat|grepprg|gtl|gtt|guicursor|guifont|guifontset|guifontwide|guiheadroom|guioptions|guipty|guitablabel|guitabtooltip|helpfile|helpheight|helplang|hf|hh|hi|hid|hidden|highlight|history|hk|hkmap|hkmapp|hkp|hl|hlg|hls|hlsearch|ic|icon|iconstring|ignorecase|im|imactivatekey|imak|imc|imcmdline|imd|imdisable|imi|iminsert|ims|imsearch|inc|include|includeexpr|incsearch|inde|indentexpr|indentkeys|indk|inex|inf|infercase|insertmode|is|isf|isfname|isi|isident|isk|iskeyword|isp|isprint|joinspaces|js|key|keymap|keymodel|keywordprg|km|kmp|kp|langmap|langmenu|laststatus|lazyredraw|lbr|lcs|linebreak|lines|linespace|lisp|lispwords|list|listchars|lm|lmap|loadplugins|lpl|ls|lsp|lw|lz|ma|macatsui|magic|makeef|makeprg|mat|matchpairs|matchtime|maxcombine|maxfuncdepth|maxmapdepth|maxmem|maxmempattern|maxmemtot|mco|mef|menuitems|mfd|mh|mis|mkspellmem|ml|mls|mm|mmd|mmp|mmt|mod|modeline|modelines|modifiable|modified|more|mouse|mousef|mousefocus|mousehide|mousem|mousemodel|mouses|mouseshape|mouset|mousetime|mp|mps|msm|mzq|mzquantum|nf|nrformats|nu|number|numberwidth|nuw|odev|oft|ofu|omnifunc|opendevice|operatorfunc|opfunc|osfiletype|pa|para|paragraphs|paste|pastetoggle|patchexpr|patchmode|path|pdev|penc|pex|pexpr|pfn|ph|pheader|pi|pm|pmbcs|pmbfn|popt|preserveindent|previewheight|previewwindow|printdevice|printencoding|printexpr|printfont|printheader|printmbcharset|printmbfont|printoptions|prompt|pt|pumheight|pvh|pvw|qe|quoteescape|readonly|remap|report|restorescreen|revins|ri|rightleft|rightleftcmd|rl|rlc|ro|rs|rtp|ru|ruf|ruler|rulerformat|runtimepath|sb|sbo|sbr|sc|scb|scr|scroll|scrollbind|scrolljump|scrolloff|scrollopt|scs|sect|sections|secure|sel|selection|selectmode|sessionoptions|sft|sh|shcf|shell|shellcmdflag|shellpipe|shellquote|shellredir|shellslash|shelltemp|shelltype|shellxquote|shiftround|shiftwidth|shm|shortmess|shortname|showbreak|showcmd|showfulltag|showmatch|showmode|showtabline|shq|si|sidescroll|sidescrolloff|siso|sj|slm|sm|smartcase|smartindent|smarttab|smc|smd|sn|so|softtabstop|sol|sp|spc|spell|spellcapcheck|spellfile|spelllang|spellsuggest|spf|spl|splitbelow|splitright|spr|sps|sr|srr|ss|ssl|ssop|st|sta|stal|startofline|statusline|stl|stmp|sts|su|sua|suffixes|suffixesadd|sw|swapfile|swapsync|swb|swf|switchbuf|sws|sxq|syn|synmaxcol|syntax|ta|tabline|tabpagemax|tabstop|tag|tagbsearch|taglength|tagrelative|tags|tagstack|tal|tb|tbi|tbidi|tbis|tbs|tenc|term|termbidi|termencoding|terse|textauto|textmode|textwidth|tf|tgst|thesaurus|tildeop|timeout|timeoutlen|title|titlelen|titleold|titlestring|tl|tm|to|toolbar|toolbariconsize|top|tpm|tr|ts|tsl|tsr|ttimeout|ttimeoutlen|ttm|tty|ttybuiltin|ttyfast|ttym|ttymouse|ttyscroll|ttytype|tw|tx|uc|ul|undolevels|updatecount|updatetime|ut|vb|vbs|vdir|ve|verbose|verbosefile|vfile|vi|viewdir|viewoptions|viminfo|virtualedit|visualbell|vop|wa|wak|warn|wb|wc|wcm|wd|weirdinvert|wfh|wfw|wh|whichwrap|wi|wig|wildchar|wildcharm|wildignore|wildmenu|wildmode|wildoptions|wim|winaltkeys|window|winfixheight|winfixwidth|winheight|winminheight|winminwidth|winwidth|wiv|wiw|wm|wmh|wmnu|wmw|wop|wrap|wrapmargin|wrapscan|write|writeany|writebackup|writedelay|ws|ww|noacd|noai|noakm|noallowrevins|noaltkeymap|noanti|noantialias|noar|noarab|noarabic|noarabicshape|noari|noarshape|noautochdir|noautoindent|noautoread|noautowrite|noautowriteall|noaw|noawa|nobackup|noballooneval|nobeval|nobin|nobinary|nobiosk|nobioskey|nobk|nobl|nobomb|nobuflisted|nocf|noci|nocin|nocindent|nocompatible|noconfirm|noconsk|noconskey|nocopyindent|nocp|nocscopetag|nocscopeverbose|nocst|nocsverb|nocuc|nocul|nocursorcolumn|nocursorline|nodeco|nodelcombine|nodg|nodiff|nodigraph|nodisable|noea|noeb|noed|noedcompatible|noek|noendofline|noeol|noequalalways|noerrorbells|noesckeys|noet|noex|noexpandtab|noexrc|nofen|nofk|nofkmap|nofoldenable|nogd|nogdefault|noguipty|nohid|nohidden|nohk|nohkmap|nohkmapp|nohkp|nohls|nohlsearch|noic|noicon|noignorecase|noim|noimc|noimcmdline|noimd|noincsearch|noinf|noinfercase|noinsertmode|nois|nojoinspaces|nojs|nolazyredraw|nolbr|nolinebreak|nolisp|nolist|noloadplugins|nolpl|nolz|noma|nomacatsui|nomagic|nomh|noml|nomod|nomodeline|nomodifiable|nomodified|nomore|nomousef|nomousefocus|nomousehide|nonu|nonumber|noodev|noopendevice|nopaste|nopi|nopreserveindent|nopreviewwindow|noprompt|nopvw|noreadonly|noremap|norestorescreen|norevins|nori|norightleft|norightleftcmd|norl|norlc|noro|nors|noru|noruler|nosb|nosc|noscb|noscrollbind|noscs|nosecure|nosft|noshellslash|noshelltemp|noshiftround|noshortname|noshowcmd|noshowfulltag|noshowmatch|noshowmode|nosi|nosm|nosmartcase|nosmartindent|nosmarttab|nosmd|nosn|nosol|nospell|nosplitbelow|nosplitright|nospr|nosr|nossl|nosta|nostartofline|nostmp|noswapfile|noswf|nota|notagbsearch|notagrelative|notagstack|notbi|notbidi|notbs|notermbidi|noterse|notextauto|notextmode|notf|notgst|notildeop|notimeout|notitle|noto|notop|notr|nottimeout|nottybuiltin|nottyfast|notx|novb|novisualbell|nowa|nowarn|nowb|noweirdinvert|nowfh|nowfw|nowildmenu|nowinfixheight|nowinfixwidth|nowiv|nowmnu|nowrap|nowrapscan|nowrite|nowriteany|nowritebackup|nows|invacd|invai|invakm|invallowrevins|invaltkeymap|invanti|invantialias|invar|invarab|invarabic|invarabicshape|invari|invarshape|invautochdir|invautoindent|invautoread|invautowrite|invautowriteall|invaw|invawa|invbackup|invballooneval|invbeval|invbin|invbinary|invbiosk|invbioskey|invbk|invbl|invbomb|invbuflisted|invcf|invci|invcin|invcindent|invcompatible|invconfirm|invconsk|invconskey|invcopyindent|invcp|invcscopetag|invcscopeverbose|invcst|invcsverb|invcuc|invcul|invcursorcolumn|invcursorline|invdeco|invdelcombine|invdg|invdiff|invdigraph|invdisable|invea|inveb|inved|invedcompatible|invek|invendofline|inveol|invequalalways|inverrorbells|invesckeys|invet|invex|invexpandtab|invexrc|invfen|invfk|invfkmap|invfoldenable|invgd|invgdefault|invguipty|invhid|invhidden|invhk|invhkmap|invhkmapp|invhkp|invhls|invhlsearch|invic|invicon|invignorecase|invim|invimc|invimcmdline|invimd|invincsearch|invinf|invinfercase|invinsertmode|invis|invjoinspaces|invjs|invlazyredraw|invlbr|invlinebreak|invlisp|invlist|invloadplugins|invlpl|invlz|invma|invmacatsui|invmagic|invmh|invml|invmod|invmodeline|invmodifiable|invmodified|invmore|invmousef|invmousefocus|invmousehide|invnu|invnumber|invodev|invopendevice|invpaste|invpi|invpreserveindent|invpreviewwindow|invprompt|invpvw|invreadonly|invremap|invrestorescreen|invrevins|invri|invrightleft|invrightleftcmd|invrl|invrlc|invro|invrs|invru|invruler|invsb|invsc|invscb|invscrollbind|invscs|invsecure|invsft|invshellslash|invshelltemp|invshiftround|invshortname|invshowcmd|invshowfulltag|invshowmatch|invshowmode|invsi|invsm|invsmartcase|invsmartindent|invsmarttab|invsmd|invsn|invsol|invspell|invsplitbelow|invsplitright|invspr|invsr|invssl|invsta|invstartofline|invstmp|invswapfile|invswf|invta|invtagbsearch|invtagrelative|invtagstack|invtbi|invtbidi|invtbs|invtermbidi|invterse|invtextauto|invtextmode|invtf|invtgst|invtildeop|invtimeout|invtitle|invto|invtop|invtr|invttimeout|invttybuiltin|invttyfast|invtx|invvb|invvisualbell|invwa|invwarn|invwb|invweirdinvert|invwfh|invwfw|invwildmenu|invwinfixheight|invwinfixwidth|invwiv|invwmnu|invwrap|invwrapscan|invwrite|invwriteany|invwritebackup|invws|t_AB|t_AF|t_al|t_AL|t_bc|t_cd|t_ce|t_Ce|t_cl|t_cm|t_Co|t_cs|t_Cs|t_CS|t_CV|t_da|t_db|t_dl|t_DL|t_EI|t_F1|t_F2|t_F3|t_F4|t_F5|t_F6|t_F7|t_F8|t_F9|t_fs|t_IE|t_IS|t_k1|t_K1|t_k2|t_k3|t_K3|t_k4|t_K4|t_k5|t_K5|t_k6|t_K6|t_k7|t_K7|t_k8|t_K8|t_k9|t_K9|t_KA|t_kb|t_kB|t_KB|t_KC|t_kd|t_kD|t_KD|t_ke|t_KE|t_KF|t_KG|t_kh|t_KH|t_kI|t_KI|t_KJ|t_KK|t_kl|t_KL|t_kN|t_kP|t_kr|t_ks|t_ku|t_le|t_mb|t_md|t_me|t_mr|t_ms|t_nd|t_op|t_RI|t_RV|t_Sb|t_se|t_Sf|t_SI|t_so|t_sr|t_te|t_ti|t_ts|t_ue|t_us|t_ut|t_vb|t_ve|t_vi|t_vs|t_WP|t_WS|t_xs|t_ZH|t_ZR)\b/, + 'number': /\b-?(0x)?\d*\.?\d+\b/g, + 'operator': /[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, + 'punctuation': /[{}[\];(),.:]/g +}; + if (Prism.languages.markup) { Prism.languages.insertBefore('markup', 'tag', { 'script': {