From f856b6908f7fa3bca2ebf3bbd3af6be2c80f4a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Tue, 7 Apr 2020 20:59:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A7=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.dev.js | 4 +- build.prod.js | 4 +- src/css/marked.css | 1 - src/css/marked.scss | 158 ---- src/css/pager.scss | 153 ---- src/css/prism.scss | 49 -- src/css/var.scss | 4 +- src/markd/backup.js | 1366 ------------------------------- src/markd/core.js | 10 +- src/prism/base.js | 866 -------------------- src/prism/index.js | 1870 ------------------------------------------- 11 files changed, 11 insertions(+), 4474 deletions(-) delete mode 100644 src/css/marked.css delete mode 100644 src/css/marked.scss delete mode 100644 src/css/pager.scss delete mode 100644 src/css/prism.scss delete mode 100644 src/markd/backup.js delete mode 100644 src/prism/base.js delete mode 100644 src/prism/index.js diff --git a/build.dev.js b/build.dev.js index 6fe4498..09803af 100644 --- a/build.dev.js +++ b/build.dev.js @@ -15,8 +15,8 @@ const VERSION = require('./package.json').version const BUILD_DATE = new Date().format() const BASE_SCSS = ` -$ct: #3fc2a7 #19b491 #16967a; -$cg: #58d68d #2ecc71 #27ae60; +$ct: #26a69a #009688 #00897b; +$cg: #66bb6a #4caf50 #43a047; $cpp: #ac61ce #9b59b6 #8e44ad; $cb: #66b1ff #409eff #3a8ee6; $cr: #ff5061 #eb3b48 #ce3742; diff --git a/build.prod.js b/build.prod.js index 3489c8b..0304621 100644 --- a/build.prod.js +++ b/build.prod.js @@ -15,8 +15,8 @@ const VERSION = require('./package.json').version const BUILD_DATE = new Date().format() const BASE_SCSS = ` -$ct: #3fc2a7 #19b491 #16967a; -$cg: #58d68d #2ecc71 #27ae60; +$ct: #26a69a #009688 #00897b; +$cg: #66bb6a #4caf50 #43a047; $cpp: #ac61ce #9b59b6 #8e44ad; $cb: #66b1ff #409eff #3a8ee6; $cr: #ff5061 #eb3b48 #ce3742; diff --git a/src/css/marked.css b/src/css/marked.css deleted file mode 100644 index c0b6d07..0000000 --- a/src/css/marked.css +++ /dev/null @@ -1 +0,0 @@ -.do-marked-theme,.do-marked-theme-gfm,.do-marked-theme-vue{position:relative;line-height:1.5;font-size:13px;color:#62778d}.do-marked-theme a,.do-marked-theme-gfm a,.do-marked-theme-vue a{text-decoration:underline;color:#409eff}.do-marked-theme a:hover,.do-marked-theme-gfm a:hover,.do-marked-theme-vue a:hover{color:#66b1ff;text-decoration:none}.do-marked-theme em,.do-marked-theme-gfm em,.do-marked-theme-vue em{color:#7e909a}.do-marked-theme strong,.do-marked-theme-gfm strong,.do-marked-theme-vue strong{color:#425064}.do-marked-theme em,.do-marked-theme strong,.do-marked-theme del,.do-marked-theme-gfm em,.do-marked-theme-gfm strong,.do-marked-theme-gfm del,.do-marked-theme-vue em,.do-marked-theme-vue strong,.do-marked-theme-vue del{padding:0 3px}.do-marked-theme p,.do-marked-theme-gfm p,.do-marked-theme-vue p{margin:15px 0}.do-marked-theme img,.do-marked-theme-gfm img,.do-marked-theme-vue img{max-width:100%}.do-marked-theme blockquote.md-quote,.do-marked-theme-gfm blockquote.md-quote,.do-marked-theme-vue blockquote.md-quote{margin:10px 0;padding:5px 10px;border-left:5px solid #dae1e9;background:#f3f5fb;color:#aabac3}.do-marked-theme blockquote.md-quote p,.do-marked-theme-gfm blockquote.md-quote p,.do-marked-theme-vue blockquote.md-quote p{margin:0}.do-marked-theme .md-warn,.do-marked-theme .md-mark,.do-marked-theme-gfm .md-warn,.do-marked-theme-gfm .md-mark,.do-marked-theme-vue .md-warn,.do-marked-theme-vue .md-mark{display:inline-block;position:relative;min-height:35px;margin:3px 0;padding:3px 8px 3px 35px;line-height:27px;border:1px solid #f39c12;border-radius:5px;background:#fffbed;color:#e67e22;word-break:break-all}.do-marked-theme .md-warn p,.do-marked-theme .md-mark p,.do-marked-theme-gfm .md-warn p,.do-marked-theme-gfm .md-mark p,.do-marked-theme-vue .md-warn p,.do-marked-theme-vue .md-mark p{margin:0 !important}.do-marked-theme .md-warn i,.do-marked-theme .md-mark i,.do-marked-theme-gfm .md-warn i,.do-marked-theme-gfm .md-mark i,.do-marked-theme-vue .md-warn i,.do-marked-theme-vue .md-mark i{position:absolute;left:8px;top:6px;line-height:1;font-size:20px;color:#eb3b48}.do-marked-theme .md-mark,.do-marked-theme-gfm .md-mark,.do-marked-theme-vue .md-mark{border-color:#3fc2a7;color:#16967a;background:#edfbf8}.do-marked-theme .md-mark i,.do-marked-theme-gfm .md-mark i,.do-marked-theme-vue .md-mark i{color:#16967a}.do-marked-theme .md-task,.do-marked-theme-gfm .md-task,.do-marked-theme-vue .md-task{position:relative;display:inline-block;width:auto;height:30px;padding-right:10px;line-height:30px;text-align:center;cursor:default}.do-marked-theme .md-task__box,.do-marked-theme-gfm .md-task__box,.do-marked-theme-vue .md-task__box{float:left;width:18px;height:18px;margin:6px;margin-left:0;line-height:1;border:1px solid #aabac3;border-radius:3px;font-size:16px;text-align:center}.do-marked-theme .md-task.done .md-task__box,.do-marked-theme-gfm .md-task.done .md-task__box,.do-marked-theme-vue .md-task.done .md-task__box{color:#aabac3;border-color:#dae1e9;background:#dae1e9}.do-marked-theme .md-task.done .md-task__text,.do-marked-theme-gfm .md-task.done .md-task__text,.do-marked-theme-vue .md-task.done .md-task__text{color:#aabac3;text-decoration:line-through}.do-marked-theme hr,.do-marked-theme-gfm hr,.do-marked-theme-vue hr{height:1px;margin:30px 0;line-height:1px;border:0;color:#aabac3;background-color:#aabac3}.do-marked-theme ol,.do-marked-theme-gfm ol,.do-marked-theme-vue ol{margin-left:1em;list-style:decimal outside none}.do-marked-theme ul,.do-marked-theme-gfm ul,.do-marked-theme-vue ul{margin-left:1em;list-style:disc outside none}.do-marked-theme li,.do-marked-theme-gfm li,.do-marked-theme-vue li{margin:.5em 0}.do-marked-theme li ol,.do-marked-theme-gfm li ol,.do-marked-theme-vue li ol{margin-left:1em}.do-marked-theme li ul,.do-marked-theme-gfm li ul,.do-marked-theme-vue li ul{margin-left:1em;list-style-type:circle}.do-marked-theme li ol ul,.do-marked-theme li ul ul,.do-marked-theme-gfm li ol ul,.do-marked-theme-gfm li ul ul,.do-marked-theme-vue li ol ul,.do-marked-theme-vue li ul ul{list-style-type:square}.do-marked-theme h1,.do-marked-theme h2,.do-marked-theme h3,.do-marked-theme h4,.do-marked-theme h5,.do-marked-theme h6{position:relative;margin:15px 0;padding-left:30px;font-weight:normal;font-size:16px}.do-marked-theme h1 span,.do-marked-theme h2 span,.do-marked-theme h3 span,.do-marked-theme h4 span,.do-marked-theme h5 span,.do-marked-theme h6 span{position:relative;display:inline-block;padding:0 8px;background:#fff;color:#425064}.do-marked-theme h1 a,.do-marked-theme h2 a,.do-marked-theme h3 a,.do-marked-theme h4 a,.do-marked-theme h5 a,.do-marked-theme h6 a{padding:0 3px;font-weight:bold;text-decoration:none}.do-marked-theme h1 a:hover,.do-marked-theme h2 a:hover,.do-marked-theme h3 a:hover,.do-marked-theme h4 a:hover,.do-marked-theme h5 a:hover,.do-marked-theme h6 a:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.do-marked-theme h1{margin:0 0 30px;padding-left:0;font-size:24px}.do-marked-theme h1:after{display:block;width:100%;content:"";border-bottom:1px solid #dae1e9}.do-marked-theme h1 span{padding-left:0}.do-marked-theme h2:before,.do-marked-theme h3:before,.do-marked-theme h4:before,.do-marked-theme h5:before,.do-marked-theme h6:before{display:block;position:absolute;left:0;top:50%;width:100%;content:"";border-bottom:1px solid #dae1e9}.do-marked-theme h2{margin:20px 0;font-size:22px}.do-marked-theme h3{margin:20px 0 15px;font-size:20px}.do-marked-theme h4{font-size:18px}.do-marked-theme table{width:100%;line-height:25px}.do-marked-theme table thead tr{height:45px;background:#f3f5fb}.do-marked-theme table thead th{padding:10px 8px;border:0}.do-marked-theme table tbody tr{height:auto;transition:all .3s ease-in-out}.do-marked-theme table tbody tr:hover{background:#fbfbfb}.do-marked-theme table tbody td{padding:9px 8px;border-bottom:1px solid #f3f5fb}.do-marked-theme-gfm h1,.do-marked-theme-gfm h2,.do-marked-theme-gfm h3,.do-marked-theme-gfm h4,.do-marked-theme-gfm h5,.do-marked-theme-gfm h6,.do-marked-theme-vue h1,.do-marked-theme-vue h2,.do-marked-theme-vue h3,.do-marked-theme-vue h4,.do-marked-theme-vue h5,.do-marked-theme-vue h6{position:relative;margin:15px 0;font-weight:normal;font-size:16px}.do-marked-theme-gfm h1 span,.do-marked-theme-gfm h2 span,.do-marked-theme-gfm h3 span,.do-marked-theme-gfm h4 span,.do-marked-theme-gfm h5 span,.do-marked-theme-gfm h6 span,.do-marked-theme-vue h1 span,.do-marked-theme-vue h2 span,.do-marked-theme-vue h3 span,.do-marked-theme-vue h4 span,.do-marked-theme-vue h5 span,.do-marked-theme-vue h6 span{position:relative;display:inline-block;padding:0 5px;color:#425064}.do-marked-theme-gfm h1 a,.do-marked-theme-gfm h2 a,.do-marked-theme-gfm h3 a,.do-marked-theme-gfm h4 a,.do-marked-theme-gfm h5 a,.do-marked-theme-gfm h6 a,.do-marked-theme-vue h1 a,.do-marked-theme-vue h2 a,.do-marked-theme-vue h3 a,.do-marked-theme-vue h4 a,.do-marked-theme-vue h5 a,.do-marked-theme-vue h6 a{visibility:hidden;position:absolute;left:-25px;width:25px;padding:0 3px;font-weight:bold;text-decoration:none;text-align:center}.do-marked-theme-gfm h1:hover a,.do-marked-theme-gfm h2:hover a,.do-marked-theme-gfm h3:hover a,.do-marked-theme-gfm h4:hover a,.do-marked-theme-gfm h5:hover a,.do-marked-theme-gfm h6:hover a,.do-marked-theme-vue h1:hover a,.do-marked-theme-vue h2:hover a,.do-marked-theme-vue h3:hover a,.do-marked-theme-vue h4:hover a,.do-marked-theme-vue h5:hover a,.do-marked-theme-vue h6:hover a{visibility:visible}.do-marked-theme-gfm h1:after,.do-marked-theme-gfm h2:after,.do-marked-theme-gfm h3:after,.do-marked-theme-gfm h4:after,.do-marked-theme-gfm h5:after,.do-marked-theme-gfm h6:after,.do-marked-theme-vue h1:after,.do-marked-theme-vue h2:after,.do-marked-theme-vue h3:after,.do-marked-theme-vue h4:after,.do-marked-theme-vue h5:after,.do-marked-theme-vue h6:after{display:block;width:100%;content:"";border-bottom:1px solid #dae1e9}.do-marked-theme-gfm h1,.do-marked-theme-vue h1{margin:0 0 30px;font-size:24px}.do-marked-theme-gfm h2,.do-marked-theme-vue h2{margin:20px 0;font-size:22px}.do-marked-theme-gfm h3,.do-marked-theme-vue h3{margin:20px 0 15px;font-size:20px}.do-marked-theme-gfm h4,.do-marked-theme-vue h4{font-size:18px}.do-marked-theme-gfm table,.do-marked-theme-vue table{border-spacing:0;border-collapse:collapse}.do-marked-theme-gfm table tr,.do-marked-theme-vue table tr{border-top:1px solid #ccc;background-color:#fff}.do-marked-theme-gfm table th,.do-marked-theme-gfm table td,.do-marked-theme-vue table th,.do-marked-theme-vue table td{padding:6px 13px;border:1px solid #ddd}.do-marked-theme-gfm table th,.do-marked-theme-vue table th{font-weight:bold}.do-marked-theme-gfm table tr:nth-child(2n),.do-marked-theme-vue table tr:nth-child(2n){background-color:#fbfbfb}.do-marked-theme-gfm{color:#425064}.do-marked-theme-gfm blockquote.md-quote{background:none}.do-marked-theme-gfm .do-ui-blockcode,.do-marked-theme-gfm .do-ui-inlinecode{border:1px solid #dae1e9}.do-marked-theme-gfm .do-ui-inlinecode{color:inherit}.do-marked-theme-vue a{color:#19b491}.do-marked-theme-vue a:hover{color:#3fc2a7}.do-marked-theme-vue blockquote.md-quote{border-color:#3fc2a7;background:#f2faf7}.do-marked-theme-vue h1,.do-marked-theme-vue h2,.do-marked-theme-vue h3,.do-marked-theme-vue h4,.do-marked-theme-vue h5,.do-marked-theme-vue h6{font-weight:bold}.do-marked-theme-vue h1 span,.do-marked-theme-vue h2 span,.do-marked-theme-vue h3 span,.do-marked-theme-vue h4 span,.do-marked-theme-vue h5 span,.do-marked-theme-vue h6 span{color:inherit}.do-marked-theme-vue h1:after,.do-marked-theme-vue h2:after,.do-marked-theme-vue h3:after,.do-marked-theme-vue h4:after,.do-marked-theme-vue h5:after,.do-marked-theme-vue h6:after{display:none}.do-marked-theme-vue table{display:table}.do-marked-theme-vue table thead tr{background:#f3f5fb}.do-marked-theme-vue .do-ui-inlinecode{color:#e67e22} diff --git a/src/css/marked.scss b/src/css/marked.scss deleted file mode 100644 index a2c24d2..0000000 --- a/src/css/marked.scss +++ /dev/null @@ -1,158 +0,0 @@ -@charset "UTF-8"; -/** - * - * @authors yutent (yutent@doui.cc) - * @date 2017-09-29 00:05:45 - * @version $Id$ - */ -@import "var.scss"; - -.do-marked-theme, -.do-marked-theme-gfm, -.do-marked-theme-vue {position:relative;line-height:1.5;font-size:13px;color:nth($cd, 1); - - a {text-decoration:underline;color:nth($cb, 2)} - a:hover {color:nth($cb, 1);text-decoration:none;} - em {color:nth($cgr, 3);} - strong {color:nth($cd, 3);} - em,strong,del {padding:0 3px;} - p {margin:15px 0;} - img {max-width:100%;} - - blockquote { - &.md-quote {margin:10px 0;padding:5px 10px;border-left:5px solid nth($cp, 3);background:nth($cp, 1);color:nth($cgr, 1); - - p {margin:0;} - } - } - - - /* 提醒文本 */ - .md-warn,.md-mark {display:inline-block;position:relative;min-height:35px;margin:3px 0;padding:3px 8px 3px 35px;line-height:27px;border:1px solid nth($co, 2);border-radius:5px;background:#fffbed;color:nth($co, 3);word-break: break-all; - - p {margin:0!important;} - i {position:absolute;left:8px;top:6px;line-height:1;font-size:20px;color:nth($cr, 2);} - } - .md-mark {border-color:nth($ct, 1);color:nth($ct, 3);background:#edfbf8; - i {color:nth($ct, 3);} - } - .md-task {position:relative;display:inline-block;width:auto;height:30px;padding-right:10px;line-height:30px;text-align:center;cursor:default; - - &__box {float:left;width:18px;height:18px;margin:6px;margin-left:0;line-height:1;border:1px solid nth($cgr, 1);border-radius:3px;font-size:16px;text-align:center;} - &.done { - .md-task__box {color:nth($cgr, 1);border-color:nth($cp, 3);background:nth($cp, 3);} - .md-task__text {color:nth($cgr, 1);text-decoration:line-through;} - } - } - - hr {height:1px;margin:30px 0;line-height:1px;border:0;color:nth($cgr, 1);background-color:nth($cgr, 1);} - ol {margin-left:1em;list-style:decimal outside none;} - ul {margin-left:1em;list-style:disc outside none;} - li {margin:.5em 0;} - li ol {margin-left:1em;} - li ul {margin-left:1em;list-style-type: circle;} - li ol ul, - li ul ul {list-style-type: square;} - -} - -.do-marked-theme { - - h1,h2,h3,h4,h5,h6 {position:relative;margin:15px 0;padding-left:30px;font-weight:normal;font-size:16px; - - span {position:relative;display:inline-block;padding:0 8px;background:#fff;color:nth($cd, 3);} - a {padding:0 3px;font-weight:bold;text-decoration:none;} - a:hover {transform:scale(1.2)} - } - h1 {margin:0 0 30px;padding-left:0;font-size:24px; - - &:after {display:block;width:100%;content:"";border-bottom:1px solid nth($cp, 3);} - span {padding-left:0;} - } - h2,h3,h4,h5,h6 { - &:before {display:block;position:absolute;left:0;top:50%;width:100%;content:"";border-bottom:1px solid nth($cp, 3);} - } - h2 {margin:20px 0;font-size:22px;} - h3 {margin:20px 0 15px;font-size:20px;} - h4 {font-size:18px;} - - - - table {width:100%;line-height:25px; - thead tr {height:45px;background:nth($cp, 1)} - thead th {padding:10px 8px;border:0;} - tbody tr {height:auto;@include ts(all, .3s); - &:hover {background:#fbfbfb;} - } - tbody td {padding:9px 8px;border-bottom:1px solid nth($cp, 1)} - } - - -} - -.do-marked-theme-gfm, -.do-marked-theme-vue { - - h1,h2,h3,h4,h5,h6 {position:relative;margin:15px 0;font-weight:normal;font-size:16px; - - span {position:relative;display:inline-block;padding:0 5px;color:nth($cd, 3);} - a {visibility:hidden;position:absolute;left:-25px;width:25px;padding:0 3px;font-weight:bold;text-decoration:none;text-align:center;} - &:hover a {visibility:visible;} - &:after {display:block;width:100%;content:"";border-bottom:1px solid nth($cp, 3);} - } - h1 {margin:0 0 30px;font-size:24px;} - h2 {margin:20px 0;font-size:22px;} - h3 {margin:20px 0 15px;font-size:20px;} - h4 {font-size:18px;} - - table {border-spacing:0;border-collapse:collapse; - - tr {border-top:1px solid #ccc;background-color: #fff;} - th, td {padding:6px 13px;border:1px solid #ddd;} - th {font-weight:bold;} - tr:nth-child(2n) {background-color:#fbfbfb;} - } -} - -.do-marked-theme-gfm {color:nth($cd, 3); - - blockquote { - &.md-quote {background:none; - - } - } - - - .do-ui-blockcode,.do-ui-inlinecode {border:1px solid nth($cp, 3)} - .do-ui-inlinecode {color:inherit;} - -} - - - -.do-marked-theme-vue { - - a {color:nth($ct, 2)} - a:hover {color:nth($ct, 1);} - - blockquote { - &.md-quote {border-color:nth($ct, 1);background:#f2faf7; - - } - } - - h1,h2,h3,h4,h5,h6 {font-weight:bold; - span {color:inherit;} - &:after {display:none;} - } - - - table {display:table; - thead tr {background:nth($cp, 1)} - } - - .do-ui-blockcode,.do-ui-inlinecode {} - .do-ui-inlinecode {color:nth($co, 3);} - -} - diff --git a/src/css/pager.scss b/src/css/pager.scss deleted file mode 100644 index 982a0d5..0000000 --- a/src/css/pager.scss +++ /dev/null @@ -1,153 +0,0 @@ -@charset "UTF-8"; -/** - * - * @authors yutent (yutent@doui.cc) - * @date 2017-09-08 20:03:06 - * @version $Id$ - */ - -@import "var.scss"; - -.do-pager {display:block;height:auto;text-align:center;font-size:14px;color: nth($cgr, 2); - - &.mini {line-height:30px; - .button,.page {min-width:30px;height:30px} - } - &.medium {line-height:35px; - .button,.page {min-width:35px;height:35px} - } - &.large {line-height:40px; - .button,.page {min-width:40px;height:40px} - } - - .button,.page {display:inline-block;border:0;color: nth($cgr, 2);text-decoration:none;cursor:pointer;vertical-align:top;font-size:14px;font-weight:100;appearance:none;} - .button {font-size:18px;} - .curr, .disabled {cursor:default;} - - &.skin-1 {width:100%; - - .page, - .button, - .disabled, - .curr {padding:0 8px;margin:0 3px;} - - .curr {font-weight:bold;font-size:15px;} - .page.disabled {min-width:0;padding:0;background:none;color:nth($cgr, 2); - &:hover,&:active {background:none;} - } - .page.curr {background:none;color:nth($cgr, 2); - &:hover,&:active {background:none;} - } - .button[disabled] {cursor:not-allowed;} - - .total-box,.input-box {display:inline-block;padding:0 8px;} - .input-box input {display:inline-block;width:40px;height:30px;padding:0 3px;font-size:14px;background:#fff;border:1px solid #ddd;text-align:center;} - } - - &.skin-2 {float:right;width:auto; - - .page, - .button, - .disabled, - .curr {float:left;margin:0;padding:0 5px;color:#fff;} - - .page.disabled {display:none;} - .button[disabled] {cursor:not-allowed;} - - .input-box {display:none;} - .total-box {float:left;display:inline-block;padding:0 8px;} - } - - &.plain { - .page,.button {background:nth($cp, 2);color:nth($cgr, 2); - - &:hover {background:nth($cp, 1)} - &:active {background:nth($cp, 3)} - } - .button[disabled] {background:nth($cp, 2);} - &.skin-2 .curr {background:nth($cp, 3)} - } - - &.grey { - .page,.button {background:nth($cgr, 2);color: #fff; - - &:hover {background:nth($cgr, 1)} - &:active {background:nth($cgr, 3)} - } - .button[disabled] {background:nth($cgr, 2);} - &.skin-2 .curr {background:nth($cgr, 3)} - } - - &.dark { - .page,.button {background:nth($cd, 2);color: #fff; - - &:hover {background:nth($cd, 2)} - &:active {background:nth($cd, 3)} - } - .button[disabled] {background:nth($cd, 2);} - &.skin-2 .curr {background:nth($cd, 3)} - } - - &.red { - .page,.button {background:nth($cr, 2);color: #fff; - - &:hover {background:nth($cr, 1)} - &:active {background:nth($cr, 3)} - } - .button[disabled] {background:nth($cr, 2);} - &.skin-2 .curr {background:nth($cr, 3)} - } - - &.orange { - .page,.button {background:nth($co, 2);color: #fff; - - &:hover {background:nth($co, 1)} - &:active {background:nth($co, 3)} - } - .button[disabled] {background:nth($co, 2);} - &.skin-2 .curr {background:nth($co, 3)} - } - - &.green { - .page,.button {background:nth($cg, 2);color: #fff; - - &:hover {background:nth($cg, 1)} - &:active {background:nth($cg, 3)} - } - .button[disabled] {background:nth($cg, 2);} - &.skin-2 .curr {background:nth($cg, 3)} - } - - &.teal { - .page,.button {background:nth($ct, 2);color: #fff; - - &:hover {background:nth($ct, 1)} - &:active {background:nth($ct, 3)} - } - .button[disabled] {background:nth($ct, 2);} - &.skin-2 .curr {background:nth($ct, 3)} - } - - &.blue { - .page,.button {background:nth($cb, 2);color: #fff; - - &:hover {background:nth($cb, 1)} - &:active {background:nth($cb, 3)} - } - .button[disabled] {background:nth($cb, 2);} - &.skin-2 .curr {background:nth($cb, 3)} - } - - &.purple,.button { - .page {background:nth($cpp, 2);color: #fff; - - &:hover {background:nth($cpp, 1)} - &:active {background:nth($cpp, 3)} - } - .button[disabled] {background:nth($cpp, 2);} - &.skin-2 .curr {background:nth($cpp, 3)} - } - -} - - diff --git a/src/css/prism.scss b/src/css/prism.scss deleted file mode 100644 index 4ed5cf7..0000000 --- a/src/css/prism.scss +++ /dev/null @@ -1,49 +0,0 @@ -@charset "UTF-8"; -/** - * - * @authors yutent (yutent@doui.cc) - * @date 2017-02-13 13:53:38 - * - */ - -@import 'var.scss'; - -/*代码块*/ -.do-ui-blockcode {position: relative;margin: 15px 0;padding: 8px 0;line-height: 1.5;border-radius:3px;background: nth($cp, 1); - - /*语法高亮*/ - .lang {position: relative;display: block;padding: 0 8px;color: #383a42;word-wrap: break-word;white-space: pre-wrap; - - .c-comment{color: #8e908c;font-style:italic;} - .c-smartyx {color: #607d8b;} - .c-important {color: #f5871f;font-style:italic;} - .c-punctuation {color: #986756;} - .c-regex {color: #c82829;} - - .c-boolean, - .c-number,.c-params {color: #f5871f;} - .c-function {color:#009688;} - - .c-class-name, - .c-build-in {color:#3aa9f3;} - - .c-class-name, - .c-build-in {font-style:italic;font-weight:bold;} - - .c-attr-name, - .c-property {color: #c79f0f;font-weight:bold;} - - - .c-string, - .c-attr-value {color: #5ab302;} - - .c-tag, - .c-keyword, - .c-selector, - .c-operator {color: #d81406;} - - .c-keyword,.c-params,.c-property {font-style:italic;} - } -} -/*行内代码*/ -.do-ui-inlinecode {display:inline-block;margin:0 2px;padding:0 5px;line-height: 1.5;color:#d14;background: nth($cp, 1);border-radius:3px;} \ No newline at end of file diff --git a/src/css/var.scss b/src/css/var.scss index ae2d183..40c7f01 100644 --- a/src/css/var.scss +++ b/src/css/var.scss @@ -1,5 +1,5 @@ -$ct: #3fc2a7 #19b491 #16967a; -$cg: #58d68d #2ecc71 #27ae60; +$ct: #26a69a #009688 #00897b; +$cg: #66bb6a #4caf50 #43a047; $cpp: #ac61ce #9b59b6 #8e44ad; $cb: #66b1ff #409eff #3a8ee6; $cr: #ff5061 #eb3b48 #ce3742; diff --git a/src/markd/backup.js b/src/markd/backup.js deleted file mode 100644 index c9e09cd..0000000 --- a/src/markd/backup.js +++ /dev/null @@ -1,1366 +0,0 @@ -/** - * marked - a markdown parser - * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) - * https://github.com/chjj/marked - */ - -// import 'css/marked.scss' -/** - * Block-Level Grammar - */ - -class Fixer { - constructor(exp, sign) { - this.exp = exp - this.sign = sign - } - replace(key, val) { - if (key) { - val = val.source || val - val = val.replace(/(^|[^\[])\^/g, '$1') - this.exp = this.exp.replace(key, val) - } - return this - } - - done() { - return new RegExp(this.exp, this.sign) - } -} - -function replace(exp, sign) { - return new Fixer(exp.source, sign || '') -} - -const block = { - newline: /^\n+/, - code: /^( {4}[^\n]+\n*)+/, - fences: noop, - hr: /^( *[-*_]){3,} *(?:\n+|$)/, - heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, - nptable: noop, - lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, - mark: /^ *;;;([\!]?) ([^\n]+)/, - task: /^ *- *\[([ x]?)\] *([^\n]*)/, - list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, - def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, - table: noop, - paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, - text: /^[^\n]+/ -} - -block.bullet = /(?:[*+-]|\d+\.)/ -block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/ -block.item = replace(block.item, 'gm') - .replace(/bull/g, block.bullet) - .done() - -block.list = replace(block.list) - .replace(/bull/g, block.bullet) - .replace('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') - .replace('def', '\\n+(?=' + block.def.source + ')') - .done() - -block.blockquote = replace(block.blockquote) - .replace('def', block.def) - .done() - -block._tag = - '(?!(?:' + - 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + - '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + - '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b' - -block.html = replace(block.html) - .replace('comment', //) - .replace('closed', /<(tag)[\s\S]+?<\/\1>/) - .replace('closing', /])*?>/) - .replace(/tag/g, block._tag) - .done() - -block.paragraph = replace(block.paragraph) - .replace('hr', block.hr) - .replace('heading', block.heading) - .replace('lheading', block.lheading) - .replace('blockquote', block.blockquote) - .replace('tag', '<' + block._tag) - .replace('def', block.def) - .done() - -/** - * Normal Block Grammar - */ - -block.normal = merge({}, block) - -/** - * GFM Block Grammar - */ - -block.gfm = merge({}, block.normal, { - fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, - paragraph: /^/, - heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ -}) - -block.gfm.paragraph = replace(block.paragraph) - .replace( - '(?!', - '(?!' + - block.gfm.fences.source.replace('\\1', '\\2') + - '|' + - block.list.source.replace('\\1', '\\3') + - '|' - ) - .done() - -/** - * GFM + Tables Block Grammar - */ - -block.tables = merge({}, block.gfm, { - nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, - table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ -}) - -/** - * Block Lexer - */ - -function Lexer(options) { - this.tokens = [] - this.tokens.links = {} - this.options = options || marked.defaults - this.rules = block.normal - - if (this.options.gfm) { - if (this.options.tables) { - this.rules = block.tables - } else { - this.rules = block.gfm - } - } -} - -/** - * Expose Block Rules - */ - -Lexer.rules = block - -/** - * Static Lex Method - */ - -Lexer.lex = function(src, options) { - var lexer = new Lexer(options) - return lexer.lex(src) -} - -/** - * Preprocessing - */ - -Lexer.prototype.lex = function(src) { - src = src - .replace(/\r\n|\r/g, '\n') - .replace(/\t/g, ' ') - .replace(/\u00a0/g, ' ') - .replace(/\u2424/g, '\n') - - return this.token(src, true) -} - -/** - * Lexing - */ - -Lexer.prototype.token = function(src, top, bq) { - var src = src.replace(/^ +$/gm, ''), - next, - loose, - cap, - bull, - b, - item, - space, - i, - l - - while (src) { - // newline - if ((cap = this.rules.newline.exec(src))) { - src = src.substring(cap[0].length) - if (cap[0].length > 1) { - this.tokens.push({ - type: 'space' - }) - } - } - - // code - if ((cap = this.rules.code.exec(src))) { - src = src.substring(cap[0].length) - cap = cap[0].replace(/^ {4}/gm, '') - this.tokens.push({ - type: 'code', - text: !this.options.pedantic ? cap.replace(/\n+$/, '') : cap - }) - continue - } - - // fences (gfm) - if ((cap = this.rules.fences.exec(src))) { - src = src.substring(cap[0].length) - this.tokens.push({ - type: 'code', - lang: cap[2], - text: cap[3] || '' - }) - continue - } - - // heading - if ((cap = this.rules.heading.exec(src))) { - src = src.substring(cap[0].length) - this.tokens.push({ - type: 'heading', - depth: cap[1].length, - text: cap[2] - }) - continue - } - - // table no leading pipe (gfm) - if (top && (cap = this.rules.nptable.exec(src))) { - src = src.substring(cap[0].length) - - item = { - type: 'table', - header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/\n$/, '').split('\n') - } - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right' - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center' - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left' - } else { - item.align[i] = null - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i].split(/ *\| */) - } - - this.tokens.push(item) - - continue - } - - // lheading - if ((cap = this.rules.lheading.exec(src))) { - src = src.substring(cap[0].length) - this.tokens.push({ - type: 'heading', - depth: cap[2] === '=' ? 1 : 2, - text: cap[1] - }) - continue - } - - // hr - if ((cap = this.rules.hr.exec(src))) { - src = src.substring(cap[0].length) - this.tokens.push({ - type: 'hr' - }) - continue - } - - // blockquote - if ((cap = this.rules.blockquote.exec(src))) { - src = src.substring(cap[0].length) - - this.tokens.push({ - type: 'blockquote_start' - }) - - cap = cap[0].replace(/^ *> ?/gm, '') - - // Pass `top` to keep the current - // "toplevel" state. This is exactly - // how markdown.pl works. - this.token(cap, top, true) - - this.tokens.push({ - type: 'blockquote_end' - }) - - continue - } - - // mark - if ((cap = this.rules.mark.exec(src))) { - src = src.substring(cap[0].length) - - this.tokens.push({ - type: 'mark', - mark: cap[1] === '!', - text: cap[2] - }) - - continue - } - - if ((cap = this.rules.task.exec(src))) { - src = src.substring(cap[0].length) - - this.tokens.push({ - type: 'task', - mark: cap[1] === 'x', - text: cap[2] - }) - - continue - } - - // list - if ((cap = this.rules.list.exec(src))) { - src = src.substring(cap[0].length) - bull = cap[2] - - this.tokens.push({ - type: 'list_start', - ordered: bull.length > 1 - }) - - // Get each top-level item. - cap = cap[0].match(this.rules.item) - - next = false - l = cap.length - i = 0 - - for (; i < l; i++) { - item = cap[i] - - // Remove the list item's bullet - // so it is seen as the next token. - space = item.length - item = item.replace(/^ *([*+-]|\d+\.) +/, '') - - // Outdent whatever the - // list item contains. Hacky. - if (~item.indexOf('\n ')) { - space -= item.length - item = !this.options.pedantic - ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') - : item.replace(/^ {1,4}/gm, '') - } - - // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. - if (this.options.smartLists && i !== l - 1) { - b = block.bullet.exec(cap[i + 1])[0] - if (bull !== b && !(bull.length > 1 && b.length > 1)) { - src = cap.slice(i + 1).join('\n') + src - i = l - 1 - } - } - - // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - loose = next || /\n\n(?!\s*$)/.test(item) - if (i !== l - 1) { - next = item.charAt(item.length - 1) === '\n' - if (!loose) loose = next - } - - this.tokens.push({ - type: loose ? 'loose_item_start' : 'list_item_start' - }) - - // Recurse. - this.token(item, false, bq) - - this.tokens.push({ - type: 'list_item_end' - }) - } - - this.tokens.push({ - type: 'list_end' - }) - - continue - } - - // html - if ((cap = this.rules.html.exec(src))) { - src = src.substring(cap[0].length) - this.tokens.push({ - type: this.options.sanitize ? 'paragraph' : 'html', - pre: - !this.options.sanitizer && - (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), - text: cap[0] - }) - continue - } - - // def - if (!bq && top && (cap = this.rules.def.exec(src))) { - src = src.substring(cap[0].length) - this.tokens.links[cap[1].toLowerCase()] = { - href: cap[2], - title: cap[3] - } - continue - } - - // table (gfm) - if (top && (cap = this.rules.table.exec(src))) { - src = src.substring(cap[0].length) - - item = { - type: 'table', - header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') - } - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right' - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center' - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left' - } else { - item.align[i] = null - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i] - .replace(/^ *\| *| *\| *$/g, '') - .split(/ *\| */) - } - - this.tokens.push(item) - - continue - } - - // top-level paragraph - if (top && (cap = this.rules.paragraph.exec(src))) { - src = src.substring(cap[0].length) - this.tokens.push({ - type: 'paragraph', - text: - cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1] - }) - continue - } - - // text - if ((cap = this.rules.text.exec(src))) { - // Top-level should never reach here. - src = src.substring(cap[0].length) - this.tokens.push({ - type: 'text', - text: cap[0] - }) - continue - } - - if (src) { - throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)) - } - } - - return this.tokens -} - -/** - * Inline-Level Grammar - */ - -var inline = { - escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, - autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, - url: noop, - tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, - link: /^!?\[(inside)\]\(href\)/, - reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, - nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, - strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, - em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, - code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, - br: /^ {2,}\n(?!\s*$)/, - del: noop, - text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/ - -inline.link = replace(inline.link) - .replace('inside', inline._inside) - .replace('href', inline._href) - .done() - -inline.reflink = replace(inline.reflink) - .replace('inside', inline._inside) - .done() - -/** - * Normal Inline Grammar - */ - -inline.normal = merge({}, inline) - -/** - * Pedantic Inline Grammar - */ - -inline.pedantic = merge({}, inline.normal, { - strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ -}) - -/** - * GFM Inline Grammar - */ - -inline.gfm = merge({}, inline.normal, { - escape: replace(inline.escape) - .replace('])', '~|])') - .done(), - url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, - del: /^~~(?=\S)([\s\S]*?\S)~~/, - text: replace(inline.text) - .replace(']|', '~]|') - .replace('|', '|https?://|') - .done() -}) - -/** - * GFM + Line Breaks Inline Grammar - */ - -inline.breaks = merge({}, inline.gfm, { - br: replace(inline.br) - .replace('{2,}', '*') - .done(), - text: replace(inline.gfm.text) - .replace('{2,}', '*') - .done() -}) - -/** - * Inline Lexer & Compiler - */ - -function InlineLexer(links, options) { - this.options = options || marked.defaults - this.links = links - this.rules = inline.normal - this.renderer = this.options.renderer || new Renderer() - this.renderer.options = this.options - - if (!this.links) { - throw new Error('Tokens array requires a `links` property.') - } - - if (this.options.gfm) { - if (this.options.breaks) { - this.rules = inline.breaks - } else { - this.rules = inline.gfm - } - } else if (this.options.pedantic) { - this.rules = inline.pedantic - } -} - -/** - * Expose Inline Rules - */ - -InlineLexer.rules = inline - -/** - * Static Lexing/Compiling Method - */ - -InlineLexer.output = function(src, links, options) { - var inline = new InlineLexer(links, options) - return inline.output(src) -} - -/** - * Lexing/Compiling - */ - -InlineLexer.prototype.output = function(src) { - var out = '', - link, - text, - href, - cap - - while (src) { - // escape - if ((cap = this.rules.escape.exec(src))) { - src = src.substring(cap[0].length) - out += cap[1] - continue - } - - // autolink - if ((cap = this.rules.autolink.exec(src))) { - src = src.substring(cap[0].length) - if (cap[2] === '@') { - text = - cap[1].charAt(6) === ':' - ? this.mangle(cap[1].substring(7)) - : this.mangle(cap[1]) - href = this.mangle('mailto:') + text - } else { - text = escape(cap[1]) - href = text - } - out += this.renderer.link(href, null, text) - continue - } - - // url (gfm) - if (!this.inLink && (cap = this.rules.url.exec(src))) { - src = src.substring(cap[0].length) - text = escape(cap[1]) - href = text - out += this.renderer.link(href, null, text) - continue - } - - // tag - if ((cap = this.rules.tag.exec(src))) { - if (!this.inLink && /^/i.test(cap[0])) { - this.inLink = false - } - src = src.substring(cap[0].length) - out += this.options.sanitize - ? this.options.sanitizer - ? this.options.sanitizer(cap[0]) - : escape(cap[0]) - : cap[0] - continue - } - - // link - if ((cap = this.rules.link.exec(src))) { - src = src.substring(cap[0].length) - this.inLink = true - out += this.outputLink(cap, { - href: cap[2], - title: cap[3] - }) - this.inLink = false - continue - } - - // reflink, nolink - if ( - (cap = this.rules.reflink.exec(src)) || - (cap = this.rules.nolink.exec(src)) - ) { - src = src.substring(cap[0].length) - link = (cap[2] || cap[1]).replace(/\s+/g, ' ') - link = this.links[link.toLowerCase()] - if (!link || !link.href) { - out += cap[0].charAt(0) - src = cap[0].substring(1) + src - continue - } - this.inLink = true - out += this.outputLink(cap, link) - this.inLink = false - continue - } - - // strong - if ((cap = this.rules.strong.exec(src))) { - src = src.substring(cap[0].length) - out += this.renderer.strong(this.output(cap[2] || cap[1])) - continue - } - - // em - if ((cap = this.rules.em.exec(src))) { - src = src.substring(cap[0].length) - out += this.renderer.em(this.output(cap[2] || cap[1])) - continue - } - - // code - if ((cap = this.rules.code.exec(src))) { - src = src.substring(cap[0].length) - out += this.renderer.codespan(escape(cap[2], true)) - continue - } - - // br - if ((cap = this.rules.br.exec(src))) { - src = src.substring(cap[0].length) - if (!/<[\/]?([a-z0-9\-])+[^>]*>/.test(src)) { - out += this.renderer.br() - } - continue - } - - // del (gfm) - if ((cap = this.rules.del.exec(src))) { - src = src.substring(cap[0].length) - out += this.renderer.del(this.output(cap[1])) - continue - } - - // text - if ((cap = this.rules.text.exec(src))) { - src = src.substring(cap[0].length) - out += this.renderer.text(escape(this.smartypants(cap[0]))) - continue - } - - if (src) { - throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)) - } - } - - return out -} - -/** - * Compile Link - */ - -InlineLexer.prototype.outputLink = function(cap, link) { - var href = escape(link.href), - title = link.title ? escape(link.title) : null - - return cap[0].charAt(0) !== '!' - ? this.renderer.link(href, title, this.output(cap[1])) - : this.renderer.image(href, title, escape(cap[1])) -} - -/** - * Smartypants Transformations - */ - -InlineLexer.prototype.smartypants = function(text) { - if (!this.options.smartypants) return text - return ( - text - // em-dashes - .replace(/---/g, '\u2014') - // en-dashes - .replace(/--/g, '\u2013') - // opening singles - .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') - // closing singles & apostrophes - .replace(/'/g, '\u2019') - // opening doubles - .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') - // closing doubles - .replace(/"/g, '\u201d') - // ellipses - .replace(/\.{3}/g, '\u2026') - ) -} - -/** - * Mangle Links - */ - -InlineLexer.prototype.mangle = function(text) { - if (!this.options.mangle) return text - var out = '', - l = text.length, - i = 0, - ch - - for (; i < l; i++) { - ch = text.charCodeAt(i) - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16) - } - out += '&#' + ch + ';' - } - - return out -} - -/** - * Renderer - */ - -function Renderer(options) { - this.options = options || {} -} - -Renderer.prototype.code = function(code, lang, escaped) { - code = code - .replace(/<script([^&]*?)>/g, '') - .replace(/<\/script>/g, '') - - //转义特殊字符 - code = escape(code, true) - lang = escape(lang, true) - - return '' + code + '' -} - -Renderer.prototype.blockquote = function(quote) { - return '
\n' + quote + '
\n' -} -Renderer.prototype.mark = function(mark, t) { - return `
- - - ${mark} - -
- ` -} - -Renderer.prototype.task = function(task, t) { - return `
- -
- ` -} - -Renderer.prototype.html = function(html) { - html = html.replace(/
/g, '') - return html -} - -Renderer.prototype.heading = function(text, level, raw) { - raw = text.replace(/<[^>]+>|<\/[^>]+>/g, '') - return ` - -
${text} - - ` -} - -Renderer.prototype.hr = function() { - return '
' -} - -Renderer.prototype.list = function(body, ordered) { - var type = ordered ? 'ol' : 'ul' - return '<' + type + '>\n' + body + '\n' -} - -Renderer.prototype.listitem = function(text) { - return '
  • ' + text + '
  • ' -} - -Renderer.prototype.paragraph = function(text) { - return '

    ' + text + '

    ' -} - -Renderer.prototype.table = function(header, body) { - return ( - '' + - '' + - header + - '' + - '' + - body + - '' + - '
    ' - ) -} - -Renderer.prototype.tablerow = function(content) { - return '' + content + '' -} - -Renderer.prototype.tablecell = function(content, flags) { - var type = flags.header ? 'th' : 'td' - var tag = flags.align - ? '<' + type + ' style="text-align:' + flags.align + '">' - : '<' + type + '>' - return tag + content + '' -} - -// span level renderer -Renderer.prototype.strong = function(text) { - return '' + text + '' -} - -Renderer.prototype.em = function(text) { - return '' + text + '' -} - -Renderer.prototype.codespan = function(txt) { - txt = txt.replace(/&/g, '&') - return '' + txt + '' -} - -Renderer.prototype.br = function() { - return '
    ' -} - -Renderer.prototype.del = function(text) { - return '' + text + '' -} - -Renderer.prototype.link = function(href, attr, text) { - if (this.options.sanitize) { - try { - var prot = decodeURIComponent(unescape(href)) - .replace(/[^\w:]/g, '') - .toLowerCase() - } catch (e) { - return '' - } - if ( - prot.indexOf('javascript:') === 0 || - prot.indexOf('vbscript:') === 0 || - prot.indexOf('data:') === 0 - ) { - return '' - } - } - var out = ' 1) { - return tmp[0] + '="' + tmp[1] + '"' - } else { - return 'title="' + tmp[0] + '"' - } - }) - out += attr.join(' ') - } - out += '>' + text + '' - - return out -} - -Renderer.prototype.image = function(href, title, text) { - var out = '' + text + '/g, '>') - .replace(/"/g, '"') - .replace(/'/g, ''') -} - -function unescape(html) { - // explicitly match decimal, hex, and named HTML entities - return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function( - _, - n - ) { - n = n.toLowerCase() - if (n === 'colon') return ':' - if (n.charAt(0) === '#') { - return n.charAt(1) === 'x' - ? String.fromCharCode(parseInt(n.substring(2), 16)) - : String.fromCharCode(+n.substring(1)) - } - return '' - }) -} - -function noop() {} -noop.exec = noop - -function merge(obj) { - var i = 1, - target, - key - - for (; i < arguments.length; i++) { - target = arguments[i] - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key] - } - } - } - - return obj -} - -/** - * Marked - */ - -function marked(src, opt, callback) { - if (callback || typeof opt === 'function') { - if (!callback) { - callback = opt - opt = null - } - - opt = merge({}, marked.defaults, opt || {}) - - var highlight = opt.highlight, - tokens, - pending, - i = 0 - - try { - tokens = Lexer.lex(src, opt) - } catch (e) { - return callback(e) - } - - pending = tokens.length - - var done = function(err) { - if (err) { - opt.highlight = highlight - return callback(err) - } - - var out - - try { - out = Parser.parse(tokens, opt) - } catch (e) { - err = e - } - - opt.highlight = highlight - - return err ? callback(err) : callback(null, out) - } - - if (!highlight || highlight.length < 3) { - return done() - } - - delete opt.highlight - - if (!pending) return done() - - for (; i < tokens.length; i++) { - ;(function(token) { - if (token.type !== 'code') { - return --pending || done() - } - return highlight(token.text, token.lang, function(err, code) { - if (err) return done(err) - if (code == null || code === token.text) { - return --pending || done() - } - token.text = code - token.escaped = true - --pending || done() - }) - })(tokens[i]) - } - - return - } - try { - if (opt) opt = merge({}, marked.defaults, opt) - return Parser.parse(Lexer.lex(src, opt), opt) - } catch (e) { - e.message += '\nPlease report this to https://github.com/chjj/marked.' - if ((opt || marked.defaults).silent) { - return ( - '

    An error occured:

    ' +
    -        escape(e.message + '', true) +
    -        '
    ' - ) - } - throw e - } -} - -/** - * Options - */ - -marked.options = marked.setOptions = function(opt) { - merge(marked.defaults, opt) - return marked -} -if (window.Anot) { - Anot.ui.marked = '1.0.0' -} - -marked.defaults = { - gfm: true, - tables: true, - breaks: true, - pedantic: false, - sanitize: false, - sanitizer: null, - mangle: true, - smartLists: false, - silent: false, - highlight: null, - langPrefix: 'lang-', - smartypants: false, - renderer: new Renderer() -} - -/** - * Expose - */ - -marked.Parser = Parser -marked.parser = Parser.parse - -marked.Renderer = Renderer - -marked.Lexer = Lexer -marked.lexer = Lexer.lex - -marked.InlineLexer = InlineLexer -marked.inlineLexer = InlineLexer.output - -marked.parse = marked - -marked.safe = function(txt) { - txt = txt - .trim() - .replace(/]*?)>/g, '<script$1>') - .replace(/<\/script>/g, '</script>') - return marked(txt) -} - -export default marked diff --git a/src/markd/core.js b/src/markd/core.js index eb82a4e..d6b29d1 100644 --- a/src/markd/core.js +++ b/src/markd/core.js @@ -138,8 +138,9 @@ const Decoder = { } class Tool { - constructor(list) { + constructor(list, links) { this.list = list + this.__LINKS__ = links } // 初始化字符串, 处理多余换行等 @@ -157,7 +158,6 @@ class Tool { var isCodeBlock = false // 是否代码块 var isTable = false // 是否表格 var emptyLineLength = 0 //连续空行的数量 - var ins = null for (let it of lines) { let tmp = it.trim() @@ -206,9 +206,7 @@ class Tool { } } - ins = new this(list) - ins.__LINKS__ = links - return ins + return new this(list, links) } parse() { @@ -422,6 +420,8 @@ class Tool { isParagraph = true } } + delete this.list + delete this.__LINKS__ return html } } diff --git a/src/prism/base.js b/src/prism/base.js deleted file mode 100644 index 2005e4d..0000000 --- a/src/prism/base.js +++ /dev/null @@ -1,866 +0,0 @@ -/** - * - * @authors yutent (yutent@doui.cc) - * @date 2017-08-02 21:50:34 - * @version $Id$ - */ - -import 'css/prism.scss' - -var Prism = (function() { - // Private helper vars - var lang = /\blang(?:uage)?-(\w+)\b/i - var uniqueId = 0 - - var _ = (window.Prism = { - manual: window.Prism && window.Prism.manual, - util: { - encode: function(tokens) { - if (tokens instanceof Token) { - return new Token( - tokens.type, - _.util.encode(tokens.content), - tokens.alias - ) - } else if (_.util.type(tokens) === 'Array') { - return tokens.map(_.util.encode) - } else { - return tokens - .replace(/&/g, '&') - .replace(/ text.length) { - // Something went terribly wrong, ABORT, ABORT! - break tokenloop - } - - if (str instanceof Token) { - continue - } - - pattern.lastIndex = 0 - - var match = pattern.exec(str), - delNum = 1 - - // Greedy patterns can override/remove up to two previously matched tokens - if (!match && greedy && i != strarr.length - 1) { - pattern.lastIndex = pos - match = pattern.exec(text) - if (!match) { - break - } - - var from = match.index + (lookbehind ? match[1].length : 0), - to = match.index + match[0].length, - k = i, - p = pos - - for (var len = strarr.length; k < len && p < to; ++k) { - p += strarr[k].length - // Move the index i to the element in strarr that is closest to from - if (from >= p) { - ++i - pos = p - } - } - - if (strarr[i] instanceof Token || strarr[k - 1].greedy) { - continue - } - - // Number of tokens to delete and replace with the new match - delNum = k - i - str = text.slice(pos, p) - match.index -= pos - } - - if (!match) { - continue - } - - if (lookbehind) { - lookbehindLength = match[1].length - } - - var from = match.index + lookbehindLength, - match = match[0].slice(lookbehindLength), - to = from + match.length, - before = str.slice(0, from), - after = str.slice(to) - - var args = [i, delNum] - - if (before) { - args.push(before) - } - - var wrapped = new Token( - token, - inside ? _.tokenize(match, inside) : match, - alias, - match, - greedy - ) - - args.push(wrapped) - - if (after) { - args.push(after) - } - - Array.prototype.splice.apply(strarr, args) - } - } - } - - 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) - } - } - } - }) - - var Token = (_.Token = function(type, content, alias, matchedStr, greedy) { - this.type = type - this.content = content - this.alias = alias - // Copy of the full string this token was created from - this.length = (matchedStr || '').length | 0 - this.greedy = !!greedy - }) - - Token.stringify = function(o, language, parent) { - if (typeof o == 'string') { - return o - } - - if (_.util.type(o) === 'Array') { - return o - .map(function(element) { - return Token.stringify(element, language, o) - }) - .join('') - } - - var env = { - type: o.type, - content: Token.stringify(o.content, language, parent), - tag: 'span', - classes: ['c-' + o.type], - attributes: {}, - language: language, - parent: parent - } - - if (o.alias) { - var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias] - Array.prototype.push.apply(env.classes, aliases) - } - - _.hooks.run('wrap', env) - - var attributes = Object.keys(env.attributes) - .map(function(name) { - return ( - name + - '="' + - (env.attributes[name] || '').replace(/"/g, '"') + - '"' - ) - }) - .join(' ') - - return ( - '<' + - env.tag + - ' class="' + - env.classes.join(' ') + - '"' + - (attributes ? ' ' + attributes : '') + - '>' + - env.content + - '' - ) - } - - if (!window.document) { - if (!window.addEventListener) { - // in Node.js - return window.Prism - } - // In worker - window.addEventListener( - 'message', - function(evt) { - var message = JSON.parse(evt.data), - lang = message.language, - code = message.code, - immediateClose = message.immediateClose - - window.postMessage(_.highlight(code, _.languages[lang], lang)) - if (immediateClose) { - window.close() - } - }, - false - ) - - return window.Prism - } - - //Get current script and highlight - var script = - document.currentScript || - [].slice.call(document.getElementsByTagName('script')).pop() - - if (script) { - _.filename = script.src - - if ( - document.addEventListener && - !_.manual && - !script.hasAttribute('data-manual') - ) { - if (document.readyState !== 'loading') { - if (window.requestAnimationFrame) { - window.requestAnimationFrame(_.highlightAll) - } else { - window.setTimeout(_.highlightAll, 16) - } - } else { - document.addEventListener('DOMContentLoaded', _.highlightAll) - } - } - } - - return window.Prism -})() - -Prism.languages.markup = { - smartyx: //, - comment: //, - prolog: /<\?[\w\W]+?\?>/, - doctype: //i, - cdata: //i, - tag: { - pattern: /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i, - inside: { - tag: { - pattern: /^<\/?[^\s>\/]+/i, - inside: { - punctuation: /^<\/?/, - namespace: /^[^\s>\/:]+:/ - } - }, - 'attr-value': { - pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i, - inside: { - punctuation: /[=>"']/ - } - }, - punctuation: /\/?>/, - 'attr-name': { - pattern: /[^\s>\/]+/, - inside: { - namespace: /^[^\s>\/:]+:/ - } - } - } - }, - entity: /&#?[\da-z]{1,8};/i -} - -// Plugin to make entity title show the real entity, idea by Roman Komarov -Prism.hooks.add('wrap', function(env) { - if (env.type === 'entity') { - env.attributes['title'] = env.content.replace(/&/, '&') - } -}) - -Prism.languages.xml = Prism.languages.markup -Prism.languages.html = Prism.languages.markup -Prism.languages.mathml = Prism.languages.markup -Prism.languages.svg = Prism.languages.markup - -Prism.languages.css = { - comment: /\/\*[\w\W]*?\*\//, - atrule: { - pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i, - inside: { - rule: /@[\w-]+/ - // See rest below - } - }, - url: /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, - selector: /[^\{\}\s][^\{\};]*?(?=\s*\{)/, - string: { - pattern: /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/, - greedy: true - }, - property: /(\b|\B)[\w-]+(?=\s*:)/i, - important: /\B!important\b/i, - function: /[-a-z0-9]+(?=\()/i, - punctuation: /[(){};:]/ -} - -Prism.languages.css['atrule'].inside.rest = Prism.util.clone( - Prism.languages.css -) - -if (Prism.languages.markup) { - Prism.languages.insertBefore('markup', 'tag', { - style: { - pattern: /()[\w\W]*?(?=<\/style>)/i, - lookbehind: true, - inside: Prism.languages.css, - alias: 'language-css' - } - }) - - Prism.languages.insertBefore( - 'inside', - 'attr-value', - { - 'style-attr': { - pattern: /\s*style=("|').*?\1/i, - inside: { - 'attr-name': { - pattern: /^\s*style/i, - inside: Prism.languages.markup.tag.inside - }, - punctuation: /^\s*=\s*['"]|['"]\s*$/, - 'attr-value': { - pattern: /.+/i, - inside: Prism.languages.css - } - }, - alias: 'language-css' - } - }, - Prism.languages.markup.tag - ) -} -Prism.languages.clike = { - comment: [ - { - pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, - lookbehind: true - }, - { - pattern: /(^|[^\\:])\/\/.*/, - lookbehind: true - } - ], - string: { - pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, - greedy: true - }, - 'class-name': { - pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i, - lookbehind: true, - inside: { - punctuation: /(\.|\\)/ - } - }, - keyword: /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, - boolean: /\b(true|false)\b/, - function: /[a-z0-9_]+(?=\()/i, - number: /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i, - operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, - punctuation: /[{}[\];(),.:]/ -} - -Prism.languages.javascript = Prism.languages.extend('clike', { - 'build-in': /\b(Object|Array|console|Function|String|Global|window|Buffer|Audio|Video|Date|Math|process|EventEmitter|__dirname|__filename|module|export|exports|import|require|Promise)\b/, - params: /(\(.*?\)|[A-Za-z$_][0-9A-Za-z$_]*)\s*=>/, - keyword: /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/, - number: /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/, - // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) - function: /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i, - operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*\*?|\/|~|\^|%|\.{3}/ -}) - -Prism.languages.insertBefore('javascript', 'keyword', { - regex: { - pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/, - lookbehind: true, - greedy: true - } -}) - -Prism.languages.insertBefore('javascript', 'string', { - 'template-string': { - pattern: /`(?:\\\\|\\?[^\\])*?`/, - greedy: true, - inside: { - interpolation: { - pattern: /\$\{[^}]+\}/, - inside: { - 'interpolation-punctuation': { - pattern: /^\$\{|\}$/, - alias: 'punctuation' - }, - rest: Prism.languages.javascript - } - }, - string: /[\s\S]+/ - } - } -}) - -if (Prism.languages.markup) { - Prism.languages.insertBefore('markup', 'tag', { - script: { - pattern: /()[\w\W]*?(?=<\/script>)/i, - lookbehind: true, - inside: Prism.languages.javascript, - alias: 'language-javascript' - } - }) -} - -Prism.languages.js = Prism.languages.javascript -;(function(Prism) { - var insideString = { - variable: [ - // Arithmetic Environment - { - pattern: /\$?\(\([\w\W]+?\)\)/, - inside: { - // If there is a $ sign at the beginning highlight $(( and )) as variable - variable: [ - { - pattern: /(^\$\(\([\w\W]+)\)\)/, - lookbehind: true - }, - /^\$\(\(/ - ], - number: /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/, - // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic - operator: /--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/, - // If there is no $ sign at the beginning highlight (( and )) as punctuation - punctuation: /\(\(?|\)\)?|,|;/ - } - }, - // Command Substitution - { - pattern: /\$\([^)]+\)|`[^`]+`/, - inside: { - variable: /^\$\(|^`|\)$|`$/ - } - }, - /\$(?:[a-z0-9_#\?\*!@]+|\{[^}]+\})/i - ] - } - - Prism.languages.bash = { - important: { - pattern: /^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/ - }, - comment: { - pattern: /(^|[^"{\\])#.*/, - lookbehind: true - }, - string: [ - //Support for Here-Documents https://en.wikipedia.org/wiki/Here_document - { - pattern: /((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g, - lookbehind: true, - greedy: true, - inside: insideString - }, - { - pattern: /(["'])(?:\\\\|\\?[^\\])*?\1/g, - greedy: true, - inside: insideString - } - ], - params: / (-[\w]+)/, - 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|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|up|update|upgrade|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|;|\||&)/, - 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|;|\||&)/, - lookbehind: true - }, - boolean: { - pattern: /(^|\s|;|\||&)(?:true|false)(?=$|\s|;|\||&)/, - lookbehind: true - }, - operator: /&&?|\|\|?|==?|!=?|<<>|<=?|>=?|=~/, - punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];]/ - } - - var inside = insideString.variable[1].inside - 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 -})(Prism) - -Prism.languages.nginx = Prism.languages.extend('clike', { - comment: { - pattern: /(^|[^"{\\])#.*/, - lookbehind: true - }, - keyword: /\b(?:CONTENT_|DOCUMENT_|GATEWAY_|HTTP_|HTTPS|if_not_empty|PATH_|QUERY_|REDIRECT_|REMOTE_|REQUEST_|SCGI|SCRIPT_|SERVER_|http|server|events|location|include|accept_mutex|accept_mutex_delay|access_log|add_after_body|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth|auth_basic|auth_basic_user_file|auth_http|auth_http_header|auth_http_timeout|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|debug_connection|debug_points|default_type|deny|devpoll_changes|devpoll_events|directio|directio_alignment|disable_symlinks|empty_gif|env|epoll_events|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_methods|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_purge|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_redirect_errors|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|google_perftools_profiles|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|imap_capabilities|imap_client_buffer|include|index|internal|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|kqueue_changes|kqueue_events|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|lock_file|log_format|log_format_combined|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|multi_accept|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|pop3_auth|pop3_capabilities|port_in_redirect|post_action|postpone_output|protocol|proxy|proxy_buffer|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_methods|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_headers_hash_bucket_size|proxy_headers_hash_max_size|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_method|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_pass_error_message|proxy_pass_header|proxy_pass_request_body|proxy_pass_request_headers|proxy_read_timeout|proxy_redirect|proxy_redirect_errors|proxy_send_lowat|proxy_send_timeout|proxy_set_body|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|proxy_timeout|proxy_upstream_fail_timeout|proxy_upstream_max_fails|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|rtsig_overflow_events|rtsig_overflow_test|rtsig_overflow_threshold|rtsig_signo|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set|set_real_ip_from|smtp_auth|smtp_capabilities|so_keepalive|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssi_value_length|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|starttls|stub_status|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timeout|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|use|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_connections|worker_cpu_affinity|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|worker_rlimit_sigpending|working_directory|xclient|xml_entities|xslt_entities|xslt_stylesheet|xslt_types)\b/i -}) - -Prism.languages.insertBefore('nginx', 'keyword', { - variable: /\$[a-z_]+/i -}) -Prism.languages.yaml = { - scalar: { - pattern: /([\-:]\s*(![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\3[^\r\n]+)*)/, - lookbehind: true, - alias: 'string' - }, - comment: /#.*/, - key: { - pattern: /(\s*(?:^|[:\-,[{\r\n?])[ \t]*(![^\s]+)?[ \t]*)[^\r\n{[\]},#\s]+?(?=\s*:\s)/, - lookbehind: true, - alias: 'atrule' - }, - directive: { - pattern: /(^[ \t]*)%.+/m, - lookbehind: true, - alias: 'important' - }, - datetime: { - pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(\d{4}-\d\d?-\d\d?([tT]|[ \t]+)\d\d?:\d{2}:\d{2}(\.\d*)?[ \t]*(Z|[-+]\d\d?(:\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(:\d{2}(\.\d*)?)?)(?=[ \t]*($|,|]|}))/m, - lookbehind: true, - alias: 'number' - }, - boolean: { - pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(true|false)[ \t]*(?=$|,|]|})/im, - lookbehind: true, - alias: 'important' - }, - null: { - pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(null|~)[ \t]*(?=$|,|]|})/im, - lookbehind: true, - alias: 'important' - }, - string: { - pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')(?=[ \t]*($|,|]|}))/m, - lookbehind: true, - greedy: true - }, - number: { - pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\da-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im, - lookbehind: true - }, - tag: /![^\s]+/, - important: /[&*][\w]+/, - punctuation: /---|[:[\]{}\-,|>?]|\.\.\./ -} -Prism.languages.other = Prism.languages.clike - -window.Prism = Prism -export default Prism diff --git a/src/prism/index.js b/src/prism/index.js deleted file mode 100644 index c388c4b..0000000 --- a/src/prism/index.js +++ /dev/null @@ -1,1870 +0,0 @@ -/** - * - * @authors yutent (yutent@doui.cc) - * @date 2017-08-02 21:50:34 - * @version $Id$ - */ - -import './base' - -Prism.languages.actionscript = Prism.languages.extend('javascript', { - keyword: /\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/, - operator: /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/ -}) -Prism.languages.actionscript['class-name'].alias = 'function' - -if (Prism.languages.markup) { - Prism.languages.insertBefore('actionscript', 'string', { - xml: { - pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\s\S])*\2)*\s*\/?>/, - lookbehind: true, - inside: { - rest: Prism.languages.markup - } - } - }) -} - -/*--------------------------------------------------------*/ - -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/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, - inside: { - 'directive-block': { - pattern: /^<\/?\w+/, - inside: { - punctuation: /^<\/?/ - }, - alias: 'tag' - }, - 'directive-block-parameter': { - pattern: /.*[^>]/, - inside: { - punctuation: /:/, - string: { - pattern: /("|').*\1/, - inside: { - variable: /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/ - } - } - }, - alias: 'attr-value' - }, - punctuation: />/ - }, - alias: 'tag' - }, - 'directive-flags': { - pattern: /\[(\w,?)+\]/, - alias: 'keyword' - }, - string: { - pattern: /("|').*\1/, - inside: { - variable: /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/ - } - }, - variable: /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/, - regex: /\^?.*\$|\^.*\$?/ -} - -/*-------------------------------------------------------------*/ - -Prism.languages.aspnet = Prism.languages.extend('markup', { - 'page-directive tag': { - pattern: /<%\s*@.*%>/i, - inside: { - 'page-directive tag': /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i, - rest: Prism.languages.markup.tag.inside - } - }, - 'directive tag': { - pattern: /<%.*%>/i, - inside: { - 'directive tag': /<%\s*?[$=%#:]{0,2}|%>/i, - rest: Prism.languages.csharp - } - } -}) -// Regexp copied from prism-markup, with a negative look-ahead added -Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^\s'">=]+))?)*\s*\/?>/i - -// match directives of attribute value foo="<% Bar %>" -Prism.languages.insertBefore( - 'inside', - 'punctuation', - { - 'directive tag': Prism.languages.aspnet['directive tag'] - }, - Prism.languages.aspnet.tag.inside['attr-value'] -) - -Prism.languages.insertBefore('aspnet', 'comment', { - 'asp comment': /<%--[\s\S]*?--%>/ -}) - -// script runat="server" contains csharp, not javascript -Prism.languages.insertBefore( - 'aspnet', - Prism.languages.javascript ? 'script' : 'tag', - { - 'asp script': { - pattern: /()[\s\S]*?(?=<\/script>)/i, - lookbehind: true, - inside: Prism.languages.csharp || {} - } - } -) - -/*-------------------------------------------------------------------*/ - -Prism.languages.basic = { - string: /"(?:""|[!#$%&'()*,\/:;<=>?^_ +\-.A-Z\d])*"/i, - comment: { - pattern: /(?:!|REM\b).+/i, - inside: { - keyword: /^REM/i - } - }, - number: /(?:\b|\B[.-])(?:\d+\.?\d*)(?:E[+-]?\d+)?/i, - keyword: /\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SHARED|SINGLE|SELECT CASE|SHELL|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i, - function: /\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i, - operator: /<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i, - punctuation: /[,;:()]/ -} - -/*----------------------------------------------------*/ - -Prism.languages.c = Prism.languages.extend('clike', { - keyword: /\b(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: /\-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*\/]/, - number: /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i -}) - -Prism.languages.insertBefore('c', 'string', { - macro: { - // allow for multiline macro definitions - // spaces after the # character compile fine with gcc - pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im, - lookbehind: true, - alias: 'property', - inside: { - // highlight the path of the include statement as a string - string: { - pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/, - lookbehind: true - }, - // highlight macro directives as keywords - directive: { - pattern: /(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/, - lookbehind: true, - alias: 'keyword' - } - } - }, - // highlight predefined macros as constants - constant: /\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/ -}) - -delete Prism.languages.c['class-name'] -delete Prism.languages.c['boolean'] - -/*---------------------------------------------------*/ -Prism.languages.csharp = Prism.languages.extend('clike', { - keyword: /\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/, - string: [ - { - pattern: /@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/, - greedy: true - }, - { - pattern: /("|')(\\?.)*?\1/, - greedy: true - } - ], - number: /\b-?(0x[\da-f]+|\d*\.?\d+f?)\b/i -}) - -Prism.languages.insertBefore('csharp', 'keyword', { - 'generic-method': { - pattern: /[a-z0-9_]+\s*<[^>\r\n]+?>\s*(?=\()/i, - alias: 'function', - inside: { - keyword: Prism.languages.csharp.keyword, - punctuation: /[<>(),.:]/ - } - }, - preprocessor: { - pattern: /(^\s*)#.*/m, - lookbehind: true, - alias: 'property', - inside: { - // highlight preprocessor directives as keywords - directive: { - pattern: /(\s*#)\b(define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/, - lookbehind: true, - alias: 'keyword' - } - } - } -}) - -/*-----------------------------------------------------------*/ - -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|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,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\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+)[a-z0-9_]+/i, - lookbehind: true - } -}) - -/*-----------------------coffeescript-----------------------*/ -;(function(Prism) { - // Ignore comments starting with { to privilege string interpolation highlighting - var comment = /#(?!\{).+/, - interpolation = { - pattern: /#\{[^}]+\}/, - alias: 'variable' - } - - Prism.languages.coffeescript = Prism.languages.extend('javascript', { - comment: comment, - string: [ - // Strings are multiline - { - pattern: /'(?:\\?[^\\])*?'/, - greedy: true - }, - - { - // Strings are multiline - pattern: /"(?:\\?[^\\])*?"/, - greedy: true, - inside: { - interpolation: interpolation - } - } - ], - keyword: /\b(and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/, - 'class-member': { - pattern: /@(?!\d)\w+/, - alias: 'variable' - } - }) - - Prism.languages.insertBefore('coffeescript', 'comment', { - 'multiline-comment': { - pattern: /###[\s\S]+?###/, - alias: 'comment' - }, - - // Block regexp can contain comments and interpolation - 'block-regex': { - pattern: /\/{3}[\s\S]*?\/{3}/, - alias: 'regex', - inside: { - comment: comment, - interpolation: interpolation - } - } - }) - - Prism.languages.insertBefore('coffeescript', 'string', { - 'inline-javascript': { - pattern: /`(?:\\?[\s\S])*?`/, - inside: { - delimiter: { - pattern: /^`|`$/, - alias: 'punctuation' - }, - rest: Prism.languages.javascript - } - }, - - // Block strings - 'multiline-string': [ - { - pattern: /'''[\s\S]*?'''/, - greedy: true, - alias: 'string' - }, - { - pattern: /"""[\s\S]*?"""/, - greedy: true, - alias: 'string', - inside: { - interpolation: interpolation - } - } - ] - }) - - Prism.languages.insertBefore('coffeescript', 'keyword', { - // Object property - property: /(?!\d)\w+(?=\s*:(?!:))/ - }) - - delete Prism.languages.coffeescript['template-string'] -})(Prism) - -/*---------------------------ruby---------------------------*/ -;(function(Prism) { - Prism.languages.ruby = Prism.languages.extend('clike', { - comment: [ - /#(?!\{[^\r\n]*?\}).*/, - /^=begin(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?=end/m - ], - 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|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/ - }) - - var interpolation = { - pattern: /#\{[^}]+\}/, - inside: { - delimiter: { - pattern: /^#\{|\}$/, - alias: 'tag' - }, - rest: Prism.util.clone(Prism.languages.ruby) - } - } - - Prism.languages.insertBefore('ruby', 'keyword', { - regex: [ - { - pattern: /%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/, - greedy: true, - inside: { - interpolation: interpolation - } - }, - { - pattern: /%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/, - greedy: true, - inside: { - interpolation: interpolation - } - }, - { - // Here we need to specifically allow interpolation - pattern: /%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/, - greedy: true, - inside: { - interpolation: interpolation - } - }, - { - pattern: /%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/, - greedy: true, - inside: { - interpolation: interpolation - } - }, - { - pattern: /%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/, - greedy: true, - inside: { - interpolation: interpolation - } - }, - { - pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/, - lookbehind: true, - greedy: true - } - ], - variable: /[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/, - symbol: /:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/ - }) - - Prism.languages.insertBefore('ruby', 'number', { - builtin: /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, - constant: /\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/ - }) - - Prism.languages.ruby.string = [ - { - pattern: /%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/, - greedy: true, - inside: { - interpolation: interpolation - } - }, - { - pattern: /%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/, - greedy: true, - inside: { - interpolation: interpolation - } - }, - { - // Here we need to specifically allow interpolation - pattern: /%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/, - greedy: true, - inside: { - interpolation: interpolation - } - }, - { - pattern: /%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/, - greedy: true, - inside: { - interpolation: interpolation - } - }, - { - pattern: /%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/, - greedy: true, - inside: { - interpolation: interpolation - } - }, - { - pattern: /("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/, - greedy: true, - inside: { - interpolation: interpolation - } - } - ] -})(Prism) - -/*-------------------------------------------------------------*/ - -Prism.languages.d = Prism.languages.extend('clike', { - string: [ - // r"", x"" - /\b[rx]"(\\.|[^\\"])*"[cwd]?/, - // q"[]", q"()", q"<>", q"{}" - /\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/, - // q"IDENT - // ... - // IDENT" - /\bq"([_a-zA-Z][_a-zA-Z\d]*)(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\1"/, - // q"//", q"||", etc. - /\bq"(.)[\s\S]*?\1"/, - // Characters - /'(?:\\'|\\?[^']+)'/, - - /(["`])(\\.|(?!\1)[^\\])*\1[cwd]?/ - ], - - number: [ - // The lookbehind and the negative look-ahead try to prevent bad highlighting of the .. operator - // Hexadecimal numbers must be handled separately to avoid problems with exponent "e" - /\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]*/i, - { - pattern: /((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]*/i, - lookbehind: true - } - ], - - // In order: $, keywords and special tokens, globally defined symbols - keyword: /\$|\b(?:abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|real|ref|return|scope|shared|short|static|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|__(?:(?:FILE|MODULE|LINE|FUNCTION|PRETTY_FUNCTION|DATE|EOF|TIME|TIMESTAMP|VENDOR|VERSION)__|gshared|traits|vector|parameters)|string|wstring|dstring|size_t|ptrdiff_t)\b/, - operator: /\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/ -}) - -Prism.languages.d.comment = [ - // Shebang - /^\s*#!.+/, - // /+ +/ - { - // Allow one level of nesting - pattern: /(^|[^\\])\/\+(?:\/\+[\s\S]*?\+\/|[\s\S])*?\+\//, - lookbehind: true - } -].concat(Prism.languages.d.comment) - -Prism.languages.insertBefore('d', 'comment', { - 'token-string': { - // Allow one level of nesting - pattern: /\bq\{(?:|\{[^}]*\}|[^}])*\}/, - alias: 'string' - } -}) - -Prism.languages.insertBefore('d', 'keyword', { - property: /\B@\w*/ -}) - -Prism.languages.insertBefore('d', 'function', { - register: { - // Iasm registers - pattern: /\b(?:[ABCD][LHX]|E[ABCD]X|E?(?:BP|SP|DI|SI)|[ECSDGF]S|CR[0234]|DR[012367]|TR[3-7]|X?MM[0-7]|R[ABCD]X|[BS]PL|R[BS]P|[DS]IL|R[DS]I|R(?:[89]|1[0-5])[BWD]?|XMM(?:[89]|1[0-5])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/, - alias: 'variable' - } -}) -Prism.languages.dart = Prism.languages.extend('clike', { - string: [ - { - pattern: /r?("""|''')[\s\S]*?\1/, - greedy: true - }, - { - pattern: /r?("|')(\\?.)*?\1/, - greedy: true - } - ], - keyword: [ - /\b(?:async|sync|yield)\*/, - /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|default|deferred|do|dynamic|else|enum|export|external|extends|factory|final|finally|for|get|if|implements|import|in|library|new|null|operator|part|rethrow|return|set|static|super|switch|this|throw|try|typedef|var|void|while|with|yield)\b/ - ], - operator: /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/ -}) - -Prism.languages.insertBefore('dart', 'function', { - metadata: { - pattern: /@\w+/, - alias: 'symbol' - } -}) - -/*-----------------------------------------------------------*/ - -Prism.languages.docker = { - keyword: { - pattern: /(^\s*)(?:ONBUILD|FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|COPY|VOLUME|USER|WORKDIR|CMD|LABEL|ENTRYPOINT)(?=\s)/im, - lookbehind: true - }, - string: /("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*?\1/, - comment: /#.*/, - punctuation: /---|\.\.\.|[:[\]{}\-,|>?]/ -} -Prism.languages.erlang = { - comment: /%.+/, - string: { - pattern: /"(?:\\?.)*?"/, - greedy: true - }, - 'quoted-function': { - pattern: /'(?:\\.|[^'\\])+'(?=\()/, - alias: 'function' - }, - 'quoted-atom': { - pattern: /'(?:\\.|[^'\\])+'/, - alias: 'atom' - }, - boolean: /\b(?:true|false)\b/, - keyword: /\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/, - number: [/\$\\?./, /\d+#[a-z0-9]+/i, /(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b/], - function: /\b[a-z][\w@]*(?=\()/, - variable: { - // Look-behind is used to prevent wrong highlighting of atoms containing "@" - pattern: /(^|[^@])(?:\b|\?)[A-Z_][\w@]*/, - lookbehind: true - }, - operator: [ - /[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/, - { - // We don't want to match << - pattern: /(^|[^<])<(?!<)/, - lookbehind: true - }, - { - // We don't want to match >> - pattern: /(^|[^>])>(?!>)/, - lookbehind: true - } - ], - atom: /\b[a-z][\w@]*/, - punctuation: /[()[\]{}:;,.#|]|<<|>>/ -} - -Prism.languages.git = { - comment: /^#.*/m, - deleted: /^[-–].*/m, - inserted: /^\+.*/m, - string: /("|')(\\?.)*?\1/m, - command: { - pattern: /^.*\$ git .*$/m, - inside: { - parameter: /\s(--|-)\w+/m - } - }, - coord: /^@@.*@@$/m, - commit_sha1: /^commit \w{40}$/m -} - -/*-----------------------------------------------------------*/ -Prism.languages.go = Prism.languages.extend('clike', { - keyword: /\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/, - builtin: /\b(bool|byte|complex(64|128)|error|float(32|64)|rune|string|u?int(8|16|32|64|)|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(ln)?|real|recover)\b/, - boolean: /\b(_|iota|nil|true|false)\b/, - operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./, - number: /\b(-?(0x[a-f\d]+|(\d+\.?\d*|\.\d+)(e[-+]?\d+)?)i?)\b/i, - string: { - pattern: /("|'|`)(\\?.|\r|\n)*?\1/, - greedy: true - } -}) -delete Prism.languages.go['class-name'] - -Prism.languages.haskell = { - comment: { - pattern: /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\s\S]*?-})/m, - lookbehind: true - }, - char: /'([^\\']|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/, - string: { - pattern: /"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/, - greedy: true - }, - keyword: /\b(case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/, - import_statement: { - // The imported or hidden names are not included in this import - // statement. This is because we want to highlight those exactly like - // we do for the names in the program. - pattern: /(\r?\n|\r|^)\s*import\s+(qualified\s+)?([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*(\s+as\s+([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*)?(\s+hiding\b)?/m, - inside: { - keyword: /\b(import|qualified|as|hiding)\b/ - } - }, - // These are builtin variables only. Constructors are highlighted later as a constant. - builtin: /\b(abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/, - // decimal integers and floating point numbers | octal integers | hexadecimal integers - number: /\b(\d+(\.\d+)?(e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i, - // Most of this is needed because of the meaning of a single '.'. - // If it stands alone freely, it is the function composition. - // It may also be a separator between a module name and an identifier => no - // operator. If it comes together with other special characters it is an - // operator too. - operator: /\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*`/, - // In Haskell, nearly everything is a variable, do not highlight these. - hvariable: /\b([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*\b/, - constant: /\b([A-Z][_a-zA-Z0-9']*\.)*[A-Z][_a-zA-Z0-9']*\b/, - punctuation: /[{}[\];(),.:]/ -} - -/*---------------------------jade---------------------------*/ -;(function(Prism) { - Prism.languages.jade = { - comment: { - pattern: /(^([\t ]*))\/\/.*((?:\r?\n|\r)\2[\t ]+.+)*/m, - lookbehind: true - }, - 'multiline-script': { - pattern: /(^([\t ]*)script\b.*\.[\t ]*)((?:\r?\n|\r(?!\n))(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/m, - lookbehind: true, - inside: { - rest: Prism.languages.javascript - } - }, - filter: { - pattern: /(^([\t ]*)):.+((?:\r?\n|\r(?!\n))(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/m, - lookbehind: true, - inside: { - 'filter-name': { - pattern: /^:[\w-]+/, - alias: 'variable' - } - } - }, - 'multiline-plain-text': { - pattern: /(^([\t ]*)[\w\-#.]+\.[\t ]*)((?:\r?\n|\r(?!\n))(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/m, - lookbehind: true - }, - markup: { - pattern: /(^[\t ]*)<.+/m, - lookbehind: true, - inside: { - rest: Prism.languages.markup - } - }, - doctype: { - pattern: /((?:^|\n)[\t ]*)doctype(?: .+)?/, - lookbehind: true - }, - 'flow-control': { - pattern: /(^[\t ]*)(?:if|unless|else|case|when|default|each|while)\b(?: .+)?/m, - lookbehind: true, - inside: { - each: { - pattern: /^each .+? in\b/, - inside: { - keyword: /\b(?:each|in)\b/, - punctuation: /,/ - } - }, - branch: { - pattern: /^(?:if|unless|else|case|when|default|while)\b/, - alias: 'keyword' - }, - rest: Prism.languages.javascript - } - }, - keyword: { - pattern: /(^[\t ]*)(?:block|extends|include|append|prepend)\b.+/m, - lookbehind: true - }, - mixin: [ - { - pattern: /(^[\t ]*)mixin .+/m, - lookbehind: true, - inside: { - keyword: /^mixin/, - function: /\w+(?=\s*\(|\s*$)/, - punctuation: /[(),.]/ - } - }, - { - pattern: /(^[\t ]*)\+.+/m, - lookbehind: true, - inside: { - name: { - pattern: /^\+\w+/, - alias: 'function' - }, - rest: Prism.languages.javascript - } - } - ], - script: { - pattern: /(^[\t ]*script(?:(?:&[^(]+)?\([^)]+\))*[\t ]+).+/m, - lookbehind: true, - inside: { - rest: Prism.languages.javascript - } - }, - - 'plain-text': { - pattern: /(^[\t ]*(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?[\t ]+).+/m, - lookbehind: true - }, - tag: { - pattern: /(^[\t ]*)(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?:?/m, - lookbehind: true, - inside: { - attributes: [ - { - pattern: /&[^(]+\([^)]+\)/, - inside: { - rest: Prism.languages.javascript - } - }, - { - pattern: /\([^)]+\)/, - inside: { - 'attr-value': { - pattern: /(=\s*)(?:\{[^}]*\}|[^,)\r\n]+)/, - lookbehind: true, - inside: { - rest: Prism.languages.javascript - } - }, - 'attr-name': /[\w-]+(?=\s*!?=|\s*[,)])/, - punctuation: /[!=(),]+/ - } - } - ], - punctuation: /:/ - } - }, - code: [ - { - pattern: /(^[\t ]*(?:-|!?=)).+/m, - lookbehind: true, - inside: { - rest: Prism.languages.javascript - } - } - ], - punctuation: /[.\-!=|]+/ - } - - var filter_pattern = - '(^([\\t ]*)):{{filter_name}}((?:\\r?\\n|\\r(?!\\n))(?:\\2[\\t ]+.+|\\s*?(?=\\r?\\n|\\r)))+' - - var filters = [ - { filter: 'atpl', language: 'twig' }, - { filter: 'coffee', language: 'coffeescript' }, - 'ejs', - 'handlebars', - 'hogan', - 'less', - 'livescript', - 'markdown', - 'mustache', - 'plates', - { filter: 'sass', language: 'scss' }, - 'stylus', - 'swig' - ] - var all_filters = {} - for (var i = 0, l = filters.length; i < l; i++) { - var filter = filters[i] - filter = - typeof filter === 'string' ? { filter: filter, language: filter } : filter - if (Prism.languages[filter.language]) { - all_filters['filter-' + filter.filter] = { - pattern: RegExp( - filter_pattern.replace('{{filter_name}}', filter.filter), - 'm' - ), - lookbehind: true, - inside: { - 'filter-name': { - pattern: /^:[\w-]+/, - alias: 'variable' - }, - rest: Prism.languages[filter.language] - } - } - } - } - - Prism.languages.insertBefore('jade', 'filter', all_filters) -})(Prism) - -/*-----------------------------------------------------------*/ - -Prism.languages.java = Prism.languages.extend('clike', { - keyword: /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/, - number: /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i, - operator: { - pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m, - lookbehind: true - } -}) - -Prism.languages.insertBefore('java', 'function', { - annotation: { - alias: 'punctuation', - pattern: /(^|[^.])@\w+/, - lookbehind: true - } -}) - -Prism.languages.json = { - property: /"(?:\\.|[^\\"])*"(?=\s*:)/gi, - string: /"(?!:)(?:\\.|[^\\"])*"(?!:)/g, - number: /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/g, - punctuation: /[{}[\]);,]/g, - operator: /:/g, - boolean: /\b(true|false)\b/gi, - null: /\bnull\b/gi -} - -Prism.languages.jsonp = Prism.languages.json - -/*--------------------------kotlin----------------------------*/ -;(function(Prism) { - Prism.languages.kotlin = Prism.languages.extend('clike', { - keyword: { - // The lookbehind prevents wrong highlighting of e.g. kotlin.properties.get - pattern: /(^|[^.])\b(?:abstract|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|else|enum|final|finally|for|fun|get|if|import|in|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|out|override|package|private|protected|public|reified|return|sealed|set|super|tailrec|this|throw|to|try|val|var|when|where|while)\b/, - lookbehind: true - }, - function: [ - /\w+(?=\s*\()/, - { - pattern: /(\.)\w+(?=\s*\{)/, - lookbehind: true - } - ], - number: /\b(?:0[bx][\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?[fFL]?)\b/, - operator: /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/ - }) - - delete Prism.languages.kotlin['class-name'] - - Prism.languages.insertBefore('kotlin', 'string', { - 'raw-string': { - pattern: /(["'])\1\1[\s\S]*?\1{3}/, - alias: 'string' - // See interpolation below - } - }) - Prism.languages.insertBefore('kotlin', 'keyword', { - annotation: { - pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/, - alias: 'builtin' - } - }) - Prism.languages.insertBefore('kotlin', 'function', { - label: { - pattern: /\w+@|@\w+/, - alias: 'symbol' - } - }) - - var interpolation = [ - { - pattern: /\$\{[^}]+\}/, - inside: { - delimiter: { - pattern: /^\$\{|\}$/, - alias: 'variable' - }, - rest: Prism.util.clone(Prism.languages.kotlin) - } - }, - { - pattern: /\$\w+/, - alias: 'variable' - } - ] - - Prism.languages.kotlin['string'].inside = Prism.languages.kotlin[ - 'raw-string' - ].inside = { - interpolation: interpolation - } -})(Prism) - -/*-----------------------------------------------------------*/ - -Prism.languages.less = Prism.languages.extend('css', { - comment: [ - /\/\*[\s\S]*?\*\//, - { - pattern: /(^|[^\\])\/\/.*/, - lookbehind: true - } - ], - atrule: { - pattern: /@[\w-]+?(?:\([^{}]+\)|[^(){};])*?(?=\s*\{)/i, - inside: { - punctuation: /[:()]/ - } - }, - // selectors and mixins are considered the same - selector: { - pattern: /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{};@])*?(?=\s*\{)/, - inside: { - // mixin parameters - variable: /@+[\w-]+/ - } - }, - - property: /(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i, - punctuation: /[{}();:,]/, - operator: /[+\-*\/]/ -}) - -// Invert function and punctuation positions -Prism.languages.insertBefore('less', 'punctuation', { - function: Prism.languages.less.function -}) - -Prism.languages.insertBefore('less', 'property', { - variable: [ - // Variable declaration (the colon must be consumed!) - { - pattern: /@[\w-]+\s*:/, - inside: { - punctuation: /:/ - } - }, - - // Variable usage - /@@?[\w-]+/ - ], - 'mixin-usage': { - pattern: /([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/, - lookbehind: true, - alias: 'function' - } -}) - -/*-----------------------------------------------------------*/ - -Prism.languages.lua = { - comment: /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m, - // \z may be used to skip the following space - string: { - pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/, - greedy: true - }, - number: /\b0x[a-f\d]+\.?[a-f\d]*(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|\.?\d*(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i, - keyword: /\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/, - function: /(?!\d)\w+(?=\s*(?:[({]))/, - operator: [ - /[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/, - { - // Match ".." but don't break "..." - pattern: /(^|[^.])\.\.(?!\.)/, - lookbehind: true - } - ], - punctuation: /[\[\](){},;]|\.+|:+/ -} -Prism.languages.matlab = { - // We put string before comment, because of printf() patterns that contain "%" - string: /\B'(?:''|[^'\n])*'/, - comment: [/%\{[\s\S]*?\}%/, /%.+/], - // FIXME We could handle imaginary numbers as a whole - number: /\b-?(?:\d*\.?\d+(?:[eE][+-]?\d+)?(?:[ij])?|[ij])\b/, - keyword: /\b(?:break|case|catch|continue|else|elseif|end|for|function|if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/, - function: /(?!\d)\w+(?=\s*\()/, - operator: /\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/, - punctuation: /\.{3}|[.,;\[\](){}!]/ -} - -Prism.languages.nim = { - comment: /#.*/, - // Double-quoted strings can be prefixed by an identifier (Generalized raw string literals) - // Character literals are handled specifically to prevent issues with numeric type suffixes - string: { - pattern: /(?:(?:\b(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/, - greedy: true - }, - // The negative look ahead prevents wrong highlighting of the .. operator - number: /\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/, - keyword: /\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/, - function: { - pattern: /(?:(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/, - inside: { - operator: /\*$/ - } - }, - // We don't want to highlight operators inside backticks - ignore: { - pattern: /`[^`\r\n]+`/, - inside: { - punctuation: /`/ - } - }, - operator: { - // Look behind and look ahead prevent wrong highlighting of punctuations [. .] {. .} (. .) - // but allow the slice operator .. to take precedence over them - // One can define his own operators in Nim so all combination of operators might be an operator. - pattern: /(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|of|or|in|is|isnot|mod|not|notin|shl|shr|xor)\b)/m, - lookbehind: true - }, - punctuation: /[({\[]\.|\.[)}\]]|[`(){}\[\],:]/ -} -Prism.languages.objectivec = Prism.languages.extend('c', { - keyword: /\b(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|in|self|super)\b|(@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/, - string: /("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, - operator: /-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/ -}) - -/*-----------------------------------------------------------*/ - -Prism.languages.perl = { - comment: [ - { - // POD - pattern: /(^\s*)=\w+[\s\S]*?=cut.*/m, - lookbehind: true - }, - { - pattern: /(^|[^\\$])#.*/, - lookbehind: true - } - ], - // TODO Could be nice to handle Heredoc too. - string: [ - // q/.../ - { - pattern: /\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/, - greedy: true - }, - - // q a...a - { - pattern: /\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(?:[^\\]|\\[\s\S])*?\1/, - greedy: true - }, - - // q(...) - { - pattern: /\b(?:q|qq|qx|qw)\s*\((?:[^()\\]|\\[\s\S])*\)/, - greedy: true - }, - - // q{...} - { - pattern: /\b(?:q|qq|qx|qw)\s*\{(?:[^{}\\]|\\[\s\S])*\}/, - greedy: true - }, - - // q[...] - { - pattern: /\b(?:q|qq|qx|qw)\s*\[(?:[^[\]\\]|\\[\s\S])*\]/, - greedy: true - }, - - // q<...> - { - pattern: /\b(?:q|qq|qx|qw)\s*<(?:[^<>\\]|\\[\s\S])*>/, - greedy: true - }, - - // "...", `...` - { - pattern: /("|`)(?:[^\\]|\\[\s\S])*?\1/, - greedy: true - }, - - // '...' - // FIXME Multi-line single-quoted strings are not supported as they would break variables containing ' - { - pattern: /'(?:[^'\\\r\n]|\\.)*'/, - greedy: true - } - ], - regex: [ - // m/.../ - { - pattern: /\b(?:m|qr)\s*([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[msixpodualngc]*/, - greedy: true - }, - - // m a...a - { - pattern: /\b(?:m|qr)\s+([a-zA-Z0-9])(?:[^\\]|\\.)*?\1[msixpodualngc]*/, - greedy: true - }, - - // m(...) - { - pattern: /\b(?:m|qr)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngc]*/, - greedy: true - }, - - // m{...} - { - pattern: /\b(?:m|qr)\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngc]*/, - greedy: true - }, - - // m[...] - { - pattern: /\b(?:m|qr)\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngc]*/, - greedy: true - }, - - // m<...> - { - pattern: /\b(?:m|qr)\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngc]*/, - greedy: true - }, - - // The lookbehinds prevent -s from breaking - // FIXME We don't handle change of separator like s(...)[...] - // s/.../.../ - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s*([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\2(?:[^\\]|\\[\s\S])*?\2[msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // s a...a...a - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s+([a-zA-Z0-9])(?:[^\\]|\\[\s\S])*?\2(?:[^\\]|\\[\s\S])*?\2[msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // s(...)(...) - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s*\((?:[^()\\]|\\[\s\S])*\)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // s{...}{...} - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s*\{(?:[^{}\\]|\\[\s\S])*\}\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // s[...][...] - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s*\[(?:[^[\]\\]|\\[\s\S])*\]\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // s<...><...> - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s*<(?:[^<>\\]|\\[\s\S])*>\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // /.../ - // The look-ahead tries to prevent two divisions on - // the same line from being highlighted as regex. - // This does not support multi-line regex. - { - pattern: /\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/, - greedy: true - } - ], - - // FIXME Not sure about the handling of ::, ', and # - variable: [ - // ${^POSTMATCH} - /[&*$@%]\{\^[A-Z]+\}/, - // $^V - /[&*$@%]\^[A-Z_]/, - // ${...} - /[&*$@%]#?(?=\{)/, - // $foo - /[&*$@%]#?((::)*'?(?!\d)[\w$]+)+(::)*/i, - // $1 - /[&*$@%]\d+/, - // $_, @_, %! - // The negative lookahead prevents from breaking the %= operator - /(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/ - ], - filehandle: { - // <>, , _ - pattern: /<(?![<=])\S*>|\b_\b/, - alias: 'symbol' - }, - vstring: { - // v1.2, 1.2.3 - pattern: /v\d+(\.\d+)*|\d+(\.\d+){2,}/, - alias: 'string' - }, - function: { - pattern: /sub [a-z0-9_]+/i, - inside: { - keyword: /sub/ - } - }, - keyword: /\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|say|state|sub|switch|undef|unless|until|use|when|while)\b/, - number: /\b-?(0x[\dA-Fa-f](_?[\dA-Fa-f])*|0b[01](_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)\b/, - operator: /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor)\b/, - punctuation: /[{}[\];(),:]/ -} - -/*-----------------------------------------------------------*/ - -Prism.languages.php = Prism.languages.extend('clike', { - keyword: /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i, - constant: /\b[A-Z0-9_]{2,}\b/, - comment: { - pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, - lookbehind: true - } -}) - -// Shell-like comments are matched after strings, because they are less -// common than strings containing hashes... -Prism.languages.insertBefore('php', 'class-name', { - 'shell-comment': { - pattern: /(^|[^\\])#.*/, - lookbehind: true, - alias: 'comment' - } -}) - -Prism.languages.insertBefore('php', 'keyword', { - delimiter: { - pattern: /\?>|<\?(?:php|=)?/i, - alias: 'important' - }, - variable: /\$\w+\b/i, - package: { - pattern: /(\\|namespace\s+|use\s+)[\w\\]+/, - lookbehind: true, - inside: { - punctuation: /\\/ - } - } -}) - -// Must be defined after the function pattern -Prism.languages.insertBefore('php', 'operator', { - property: { - pattern: /(->)[\w]+/, - lookbehind: true - } -}) - -// Add HTML support if the markup language exists -if (Prism.languages.markup) { - // Tokenize all inline PHP blocks that are wrapped in - // This allows for easy PHP + markup highlighting - Prism.hooks.add('before-highlight', function(env) { - if (env.language !== 'php' || !/(?:<\?php|<\?)/gi.test(env.code)) { - return - } - - env.tokenStack = [] - - env.backupCode = env.code - env.code = env.code.replace(/(?:<\?php|<\?)[\s\S]*?(?:\?>|$)/gi, function( - match - ) { - var i = env.tokenStack.length - // Check for existing strings - while (env.backupCode.indexOf('___PHP' + i + '___') !== -1) ++i - - // Create a sparse array - env.tokenStack[i] = match - - return '___PHP' + i + '___' - }) - - // Switch the grammar to markup - env.grammar = Prism.languages.markup - }) - - // Restore env.code for other plugins (e.g. line-numbers) - Prism.hooks.add('before-insert', function(env) { - if (env.language === 'php' && env.backupCode) { - env.code = env.backupCode - delete env.backupCode - } - }) - - // Re-insert the tokens after highlighting - Prism.hooks.add('after-highlight', function(env) { - if (env.language !== 'php' || !env.tokenStack) { - return - } - - // Switch the grammar back - env.grammar = Prism.languages.php - - for (var i = 0, keys = Object.keys(env.tokenStack); i < keys.length; ++i) { - var k = keys[i] - var t = env.tokenStack[k] - - // The replace prevents $$, $&, $`, $', $n, $nn from being interpreted as special patterns - env.highlightedCode = env.highlightedCode.replace( - '___PHP' + k + '___', - '' + - Prism.highlight(t, env.grammar, 'php').replace(/\$/g, '$$$$') + - '' - ) - } - - env.element.innerHTML = env.highlightedCode - }) -} - -/*------------------------------------------------------------*/ - -Prism.languages.powershell = { - comment: [ - { - pattern: /(^|[^`])<#[\s\S]*?#>/, - lookbehind: true - }, - { - pattern: /(^|[^`])#.*/, - lookbehind: true - } - ], - string: [ - { - pattern: /"(`?[\s\S])*?"/, - greedy: true, - inside: { - function: { - pattern: /[^`]\$\(.*?\)/, - // Populated at end of file - inside: {} - } - } - }, - { - pattern: /'([^']|'')*'/, - greedy: true - } - ], - // Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices - namespace: /\[[a-z][\s\S]*?\]/i, - boolean: /\$(true|false)\b/i, - variable: /\$\w+\b/i, - // Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example - // Get-Command | ?{ $_.ModuleName -match "Microsoft.PowerShell.(Util|Core|Management)" } - // Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match "Microsoft.PowerShell.(Util|Core|Management)" } - function: [ - /\b(Add-(Computer|Content|History|Member|PSSnapin|Type)|Checkpoint-Computer|Clear-(Content|EventLog|History|Item|ItemProperty|Variable)|Compare-Object|Complete-Transaction|Connect-PSSession|ConvertFrom-(Csv|Json|StringData)|Convert-Path|ConvertTo-(Csv|Html|Json|Xml)|Copy-(Item|ItemProperty)|Debug-Process|Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Disconnect-PSSession|Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Enter-PSSession|Exit-PSSession|Export-(Alias|Clixml|Console|Csv|FormatData|ModuleMember|PSSession)|ForEach-Object|Format-(Custom|List|Table|Wide)|Get-(Alias|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Culture|Date|Event|EventLog|EventSubscriber|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|WmiObject)|Group-Object|Import-(Alias|Clixml|Csv|LocalizedData|Module|PSSession)|Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)|Join-Path|Limit-EventLog|Measure-(Command|Object)|Move-(Item|ItemProperty)|New-(Alias|Event|EventLog|Item|ItemProperty|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy)|Out-(Default|File|GridView|Host|Null|Printer|String)|Pop-Location|Push-Location|Read-Host|Receive-(Job|PSSession)|Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)|Remove-(Computer|Event|EventLog|Item|ItemProperty|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)|Rename-(Computer|Item|ItemProperty)|Reset-ComputerMachinePassword|Resolve-Path|Restart-(Computer|Service)|Restore-Computer|Resume-(Job|Service)|Save-Help|Select-(Object|String|Xml)|Send-MailMessage|Set-(Alias|Content|Date|Item|ItemProperty|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)|Show-(Command|ControlPanelItem|EventLog)|Sort-Object|Split-Path|Start-(Job|Process|Service|Sleep|Transaction)|Stop-(Computer|Job|Process|Service)|Suspend-(Job|Service)|Tee-Object|Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)|Trace-Command|Unblock-File|Undo-Transaction|Unregister-(Event|PSSessionConfiguration)|Update-(FormatData|Help|List|TypeData)|Use-Transaction|Wait-(Event|Job|Process)|Where-Object|Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning))\b/i, - /\b(ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i - ], - // per http://technet.microsoft.com/en-us/library/hh847744.aspx - keyword: /\b(Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i, - operator: { - pattern: /(\W?)(!|-(eq|ne|gt|ge|lt|le|sh[lr]|not|b?(and|x?or)|(Not)?(Like|Match|Contains|In)|Replace|Join|is(Not)?|as)\b|-[-=]?|\+[+=]?|[*\/%]=?)/i, - lookbehind: true - }, - punctuation: /[|{}[\];(),.]/ -} - -// Variable interpolation inside strings, and nested expressions -Prism.languages.powershell.string[0].inside.boolean = - Prism.languages.powershell.boolean -Prism.languages.powershell.string[0].inside.variable = - Prism.languages.powershell.variable -Prism.languages.powershell.string[0].inside.function.inside = Prism.util.clone( - Prism.languages.powershell -) - -/*------------------------------------------------------------*/ - -Prism.languages.python = { - 'triple-quoted-string': { - pattern: /"""[\s\S]+?"""|'''[\s\S]+?'''/, - alias: 'string' - }, - comment: { - pattern: /(^|[^\\])#.*/, - lookbehind: true - }, - string: { - pattern: /("|')(?:\\\\|\\?[^\\\r\n])*?\1/, - greedy: true - }, - function: { - pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g, - lookbehind: true - }, - 'class-name': { - pattern: /(\bclass\s+)[a-z0-9_]+/i, - lookbehind: true - }, - keyword: /\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/, - boolean: /\b(?:True|False)\b/, - number: /\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, - operator: /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/, - punctuation: /[{}[\];(),.:]/ -} - -Prism.languages.r = { - comment: /#.*/, - string: { - pattern: /(['"])(?:\\?.)*?\1/, - greedy: true - }, - 'percent-operator': { - // Includes user-defined operators - // and %%, %*%, %/%, %in%, %o%, %x% - pattern: /%[^%\s]*%/, - alias: 'operator' - }, - boolean: /\b(?:TRUE|FALSE)\b/, - ellipsis: /\.\.(?:\.|\d+)/, - number: [ - /\b(?:NaN|Inf)\b/, - /\b(?:0x[\dA-Fa-f]+(?:\.\d*)?|\d*\.?\d+)(?:[EePp][+-]?\d+)?[iL]?\b/ - ], - keyword: /\b(?:if|else|repeat|while|function|for|in|next|break|NULL|NA|NA_integer_|NA_real_|NA_complex_|NA_character_)\b/, - operator: /->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/, - punctuation: /[(){}\[\],;]/ -} - -/*------------------------------------------------------------*/ - -Prism.languages.rust = { - comment: [ - { - pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, - lookbehind: true - }, - { - pattern: /(^|[^\\:])\/\/.*/, - lookbehind: true - } - ], - string: [ - { - pattern: /b?r(#*)"(?:\\?.)*?"\1/, - greedy: true - }, - { - pattern: /b?("|')(?:\\?.)*?\1/, - greedy: true - } - ], - keyword: /\b(?:abstract|alignof|as|be|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|match|mod|move|mut|offsetof|once|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/, - - attribute: { - pattern: /#!?\[.+?\]/, - greedy: true, - alias: 'attr-name' - }, - - function: [ - /[a-z0-9_]+(?=\s*\()/i, - // Macros can use parens or brackets - /[a-z0-9_]+!(?=\s*\(|\[)/i - ], - 'macro-rules': { - pattern: /[a-z0-9_]+!/i, - alias: 'function' - }, - - // Hex, oct, bin, dec numbers with visual separators and type suffix - number: /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64)?|f32|f64))?\b/, - - // Closure params should not be confused with bitwise OR | - 'closure-params': { - pattern: /\|[^|]*\|(?=\s*[{-])/, - inside: { - punctuation: /[\|:,]/, - operator: /[&*]/ - } - }, - punctuation: /[{}[\];(),:]|\.+|->/, - operator: /[-+*\/%!^=]=?|@|&[&=]?|\|[|=]?|<>?=?/ -} - -/*------------------------------------------------------------*/ -;(function(Prism) { - Prism.languages.sass = Prism.languages.extend('css', { - // Sass comments don't need to be closed, only indented - comment: { - pattern: /^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t]+.+)*/m, - lookbehind: true - } - }) - - Prism.languages.insertBefore('sass', 'atrule', { - // We want to consume the whole line - 'atrule-line': { - // Includes support for = and + shortcuts - pattern: /^(?:[ \t]*)[@+=].+/m, - inside: { - atrule: /(?:@[\w-]+|[+=])/m - } - } - }) - delete Prism.languages.sass.atrule - - var variable = /((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i - var operator = [ - /[+*\/%]|[=!]=|<=?|>=?|\b(?:and|or|not)\b/, - { - pattern: /(\s+)-(?=\s)/, - lookbehind: true - } - ] - - Prism.languages.insertBefore('sass', 'property', { - // We want to consume the whole line - 'variable-line': { - pattern: /^[ \t]*\$.+/m, - inside: { - punctuation: /:/, - variable: variable, - operator: operator - } - }, - // We want to consume the whole line - 'property-line': { - pattern: /^[ \t]*(?:[^:\s]+ *:.*|:[^:\s]+.*)/m, - inside: { - property: [ - /[^:\s]+(?=\s*:)/, - { - pattern: /(:)[^:\s]+/, - lookbehind: true - } - ], - punctuation: /:/, - variable: variable, - operator: operator, - important: Prism.languages.sass.important - } - } - }) - delete Prism.languages.sass.property - delete Prism.languages.sass.important - - // Now that whole lines for other patterns are consumed, - // what's left should be selectors - delete Prism.languages.sass.selector - Prism.languages.insertBefore('sass', 'punctuation', { - selector: { - pattern: /([ \t]*)\S(?:,?[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,?[^,\r\n]+)*)*/, - lookbehind: true - } - }) -})(Prism) -Prism.languages.scss = Prism.languages.extend('css', { - comment: { - pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, - lookbehind: true - }, - atrule: { - pattern: /@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/, - inside: { - rule: /@[\w-]+/ - // See rest below - } - }, - // url, compassified - url: /(?:[-a-z]+-)*url(?=\()/i, - // CSS selector regex is not appropriate for Sass - // since there can be lot more things (var, @ directive, nesting..) - // a selector must start at the end of a property or after a brace (end of other rules or nesting) - // it can contain some characters that aren't used for defining rules or end of selector, & (parent selector), or interpolated variable - // the end of a selector is found when there is no rules in it ( {} or {\s}) or if there is a property (because an interpolated var - // can "pass" as a selector- e.g: proper#{$erty}) - // this one was hard to do, so please be careful if you edit this one :) - selector: { - // Initial look-ahead is used to prevent matching of blank selectors - pattern: /(?=\S)[^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m, - inside: { - parent: { - pattern: /&/, - alias: 'important' - }, - placeholder: /%[-_\w]+/, - variable: /\$[-_\w]+|#\{\$[-_\w]+\}/ - } - } -}) - -Prism.languages.insertBefore('scss', 'atrule', { - keyword: [ - /@(?:if|else(?: if)?|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)/i, - { - pattern: /( +)(?:from|through)(?= )/, - lookbehind: true - } - ] -}) - -Prism.languages.scss.property = { - pattern: /(?:[\w-]|\$[-_\w]+|#\{\$[-_\w]+\})+(?=\s*:)/i, - inside: { - variable: /\$[-_\w]+|#\{\$[-_\w]+\}/ - } -} - -Prism.languages.insertBefore('scss', 'important', { - // var and interpolated vars - variable: /\$[-_\w]+|#\{\$[-_\w]+\}/ -}) - -Prism.languages.insertBefore('scss', 'function', { - placeholder: { - pattern: /%[-_\w]+/, - alias: 'selector' - }, - statement: { - pattern: /\B!(?:default|optional)\b/i, - alias: 'keyword' - }, - boolean: /\b(?:true|false)\b/, - null: /\bnull\b/, - operator: { - pattern: /(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/, - lookbehind: true - } -}) - -Prism.languages.scss['atrule'].inside.rest = Prism.util.clone( - Prism.languages.scss -) - -/*-----------------------------smarty-------------------------*/ -;(function(Prism) { - var smarty_pattern = /\{\*[\s\S]+?\*\}|\{[\s\S]+?\}/g - var smarty_litteral_start = '{literal}' - var smarty_litteral_end = '{/literal}' - var smarty_litteral_mode = false - - Prism.languages.smarty = Prism.languages.extend('markup', { - smarty: { - pattern: smarty_pattern, - inside: { - delimiter: { - pattern: /^\{|\}$/i, - alias: 'punctuation' - }, - string: /(["'])(?:\\?.)*?\1/, - number: /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee][-+]?\d+)?)\b/, - variable: [ - /\$(?!\d)\w+/, - /#(?!\d)\w+#/, - { - pattern: /(\.|->)(?!\d)\w+/, - lookbehind: true - }, - { - pattern: /(\[)(?!\d)\w+(?=\])/, - lookbehind: true - } - ], - function: [ - { - pattern: /(\|\s*)@?(?!\d)\w+/, - lookbehind: true - }, - /^\/?(?!\d)\w+/, - /(?!\d)\w+(?=\()/ - ], - 'attr-name': { - // Value is made optional because it may have already been tokenized - pattern: /\w+\s*=\s*(?:(?!\d)\w+)?/, - inside: { - variable: { - pattern: /(=\s*)(?!\d)\w+/, - lookbehind: true - }, - operator: /=/ - } - }, - punctuation: [/[\[\]().,:`]|\->/], - operator: [ - /[+\-*\/%]|==?=?|[!<>]=?|&&|\|\|?/, - /\bis\s+(?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/, - /\b(?:eq|neq?|gt|lt|gt?e|lt?e|not|mod|or|and)\b/ - ], - keyword: /\b(?:false|off|on|no|true|yes)\b/ - } - } - }) - - // Comments are inserted at top so that they can - // surround markup - Prism.languages.insertBefore('smarty', 'tag', { - 'smarty-comment': { - pattern: /\{\*[\s\S]*?\*\}/, - alias: ['smarty', 'comment'] - } - }) - - // Tokenize all inline Smarty expressions - Prism.hooks.add('before-highlight', function(env) { - if (env.language !== 'smarty') { - return - } - - env.tokenStack = [] - - env.backupCode = env.code - env.code = env.code.replace(smarty_pattern, function(match) { - // Smarty tags inside {literal} block are ignored - if (match === smarty_litteral_end) { - smarty_litteral_mode = false - } - - if (!smarty_litteral_mode) { - if (match === smarty_litteral_start) { - smarty_litteral_mode = true - } - - var i = env.tokenStack.length - // Check for existing strings - while (env.backupCode.indexOf('___SMARTY' + i + '___') !== -1) ++i - - // Create a sparse array - env.tokenStack[i] = match - - return '___SMARTY' + i + '___' - } - return match - }) - }) - - // Restore env.code for other plugins (e.g. line-numbers) - Prism.hooks.add('before-insert', function(env) { - if (env.language === 'smarty') { - env.code = env.backupCode - delete env.backupCode - } - }) - - // Re-insert the tokens after highlighting - // and highlight them with defined grammar - Prism.hooks.add('after-highlight', function(env) { - if (env.language !== 'smarty') { - return - } - - for (var i = 0, keys = Object.keys(env.tokenStack); i < keys.length; ++i) { - var k = keys[i] - var t = env.tokenStack[k] - - // The replace prevents $$, $&, $`, $', $n, $nn from being interpreted as special patterns - env.highlightedCode = env.highlightedCode.replace( - '___SMARTY' + k + '___', - Prism.highlight(t, env.grammar, 'smarty').replace(/\$/g, '$$$$') - ) - } - - env.element.innerHTML = env.highlightedCode - }) -})(Prism) - -/*-----------------------------------------------------------*/ - -Prism.languages.sql = { - comment: { - pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, - lookbehind: true - }, - string: { - pattern: /(^|[^@\\])("|')(?:\\?[\s\S])*?\2/, - greedy: true, - lookbehind: true - }, - variable: /@[\w.$]+|@("|'|`)(?:\\?[\s\S])+?\1/, - function: /\b(?:COUNT|SUM|AVG|MIN|MAX|FIRST|LAST|UCASE|LCASE|MID|LEN|ROUND|NOW|FORMAT)(?=\s*\()/i, // Should we highlight user defined functions too? - keyword: /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR VARYING|CHARACTER (?:SET|VARYING)|CHARSET|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|DATA(?:BASES?)?|DATE(?:TIME)?|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITER(?:S)?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE(?: PRECISION)?|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE KEY|ELSE|ENABLE|ENCLOSED BY|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPE(?:D BY)?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTO|INVOKER|ISOLATION LEVEL|JOIN|KEYS?|KILL|LANGUAGE SQL|LAST|LEFT|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MODIFIES SQL DATA|MODIFY|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL(?: CHAR VARYING| CHARACTER(?: VARYING)?| VARCHAR)?|NATURAL|NCHAR(?: VARCHAR)?|NEXT|NO(?: SQL|CHECK|CYCLE)?|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READ(?:S SQL DATA|TEXT)?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEATABLE|REPLICATION|REQUIRE|RESTORE|RESTRICT|RETURNS?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE MODE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|START(?:ING BY)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED BY|TEXT(?:SIZE)?|THEN|TIMESTAMP|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNPIVOT|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?)\b/i, - boolean: /\b(?:TRUE|FALSE|NULL)\b/i, - number: /\b-?(?:0x)?\d*\.?[\da-f]+\b/, - operator: /[-+*\/=%^~]|&&?|\|?\||!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, - punctuation: /[;[\]()`,.]/ -} - -/*-----------------------------------------------------------*/ - -Prism.languages.swift = Prism.languages.extend('clike', { - string: { - pattern: /("|')(\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, - greedy: true, - inside: { - interpolation: { - pattern: /\\\((?:[^()]|\([^)]+\))+\)/, - inside: { - delimiter: { - pattern: /^\\\(|\)$/, - alias: 'variable' - } - // See rest below - } - } - } - }, - keyword: /\b(as|associativity|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic(?:Type)?|else|enum|extension|fallthrough|final|for|func|get|guard|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|Protocol|public|repeat|required|rethrows|return|right|safe|self|Self|set|static|struct|subscript|super|switch|throws?|try|Type|typealias|unowned|unsafe|var|weak|where|while|willSet|__(?:COLUMN__|FILE__|FUNCTION__|LINE__))\b/, - number: /\b([\d_]+(\.[\de_]+)?|0x[a-f0-9_]+(\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i, - constant: /\b(nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/, - atrule: /@\b(IB(?:Outlet|Designable|Action|Inspectable)|class_protocol|exported|noreturn|NS(?:Copying|Managed)|objc|UIApplicationMain|auto_closure)\b/, - builtin: /\b([A-Z]\S+|abs|advance|alignof(?:Value)?|assert|contains|count(?:Elements)?|debugPrint(?:ln)?|distance|drop(?:First|Last)|dump|enumerate|equal|filter|find|first|getVaList|indices|isEmpty|join|last|lexicographicalCompare|map|max(?:Element)?|min(?:Element)?|numericCast|overlaps|partition|print(?:ln)?|reduce|reflect|reverse|sizeof(?:Value)?|sort(?:ed)?|split|startsWith|stride(?:of(?:Value)?)?|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeBitCast|with(?:ExtendedLifetime|Unsafe(?:MutablePointers?|Pointers?)|VaList))\b/ -}) -Prism.languages.swift['string'].inside[ - 'interpolation' -].inside.rest = Prism.util.clone(Prism.languages.swift) -Prism.languages.typescript = Prism.languages.extend('javascript', { - // From JavaScript Prism keyword list and TypeScript language spec: https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#221-reserved-words - keyword: /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield|false|true|module|declare|constructor|string|Function|any|number|boolean|Array|enum|symbol|namespace|abstract|require|type)\b/ -}) - -Prism.languages.ts = Prism.languages.typescript -Prism.languages.vim = { - string: /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\r\n]|'')*'/, - comment: /".*/, - function: /\w+(?=\()/, - 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|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|in|inorea|inoreabbrev|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|unlet|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/, - builtin: /\b(?:autocmd|acd|ai|akm|aleph|allowrevins|altkeymap|ambiwidth|ambw|anti|antialias|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|bomb|breakat|brk|browsedir|bs|bsdir|bsk|bt|bufhidden|buflisted|buftype|casemap|ccv|cdpath|cedit|cfu|ch|charconvert|ci|cin|cindent|cink|cinkeys|cino|cinoptions|cinw|cinwords|clipboard|cmdheight|cmdwinheight|cmp|cms|columns|com|comments|commentstring|compatible|complete|completefunc|completeopt|consk|conskey|copyindent|cot|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|dy|ea|ead|eadirection|eb|ed|edcompatible|ef|efm|ei|ek|enc|encoding|endofline|eol|ep|equalalways|equalprg|errorbells|errorfile|errorformat|esckeys|et|eventignore|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|foldcolumn|foldenable|foldexpr|foldignore|foldlevel|foldlevelstart|foldmarker|foldmethod|foldminlines|foldnestmax|foldtext|formatexpr|formatlistpat|formatoptions|formatprg|fp|fs|fsync|ft|gcr|gd|gdefault|gfm|gfn|gfs|gfw|ghr|gp|grepformat|grepprg|gtl|gtt|guicursor|guifont|guifontset|guifontwide|guiheadroom|guioptions|guipty|guitablabel|guitabtooltip|helpfile|helpheight|helplang|hf|hh|hi|hidden|highlight|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|isf|isfname|isi|isident|isk|iskeyword|isprint|joinspaces|js|key|keymap|keymodel|keywordprg|km|kmp|kp|langmap|langmenu|laststatus|lazyredraw|lbr|lcs|linebreak|lines|linespace|lisp|lispwords|listchars|loadplugins|lpl|lsp|lz|macatsui|magic|makeef|makeprg|matchpairs|matchtime|maxcombine|maxfuncdepth|maxmapdepth|maxmem|maxmempattern|maxmemtot|mco|mef|menuitems|mfd|mh|mis|mkspellmem|ml|mls|mm|mmd|mmp|mmt|modeline|modelines|modifiable|modified|more|mouse|mousef|mousefocus|mousehide|mousem|mousemodel|mouses|mouseshape|mouset|mousetime|mp|mps|msm|mzq|mzquantum|nf|nrformats|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|rightleft|rightleftcmd|rl|rlc|ro|rs|rtp|ruf|ruler|rulerformat|runtimepath|sbo|sc|scb|scr|scroll|scrollbind|scrolljump|scrolloff|scrollopt|scs|sect|sections|secure|sel|selection|selectmode|sessionoptions|sft|shcf|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|smartcase|smartindent|smarttab|smc|smd|softtabstop|sol|spc|spell|spellcapcheck|spellfile|spelllang|spellsuggest|spf|spl|splitbelow|splitright|sps|sr|srr|ss|ssl|ssop|stal|startofline|statusline|stl|stmp|su|sua|suffixes|suffixesadd|sw|swapfile|swapsync|swb|swf|switchbuf|sws|sxq|syn|synmaxcol|syntax|tabline|tabpagemax|tabstop|tagbsearch|taglength|tagrelative|tagstack|tal|tb|tbi|tbidi|tbis|tbs|tenc|term|termbidi|termencoding|terse|textauto|textmode|textwidth|tgst|thesaurus|tildeop|timeout|timeoutlen|title|titlelen|titleold|titlestring|toolbar|toolbariconsize|top|tpm|tsl|tsr|ttimeout|ttimeoutlen|ttm|tty|ttybuiltin|ttyfast|ttym|ttymouse|ttyscroll|ttytype|tw|tx|uc|ul|undolevels|updatecount|updatetime|ut|vb|vbs|vdir|verbosefile|vfile|viewdir|viewoptions|viminfo|virtualedit|visualbell|vop|wak|warn|wb|wc|wcm|wd|weirdinvert|wfh|wfw|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|writeany|writebackup|writedelay|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|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[\da-f]+|\d+(?:\.\d+)?)\b/i, - operator: /\|\||&&|[-+.]=?|[=!](?:[=~][#?]?)?|[<>]=?[#?]?|[*\/%?]|\b(?:is(?:not)?)\b/, - punctuation: /[{}[\](),;:]/ -} - -export default Prism