mirror of https://github.com/abpframework/abp.git
committed by
GitHub
549 changed files with 27426 additions and 84029 deletions
@ -1,21 +1,18 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Codemirror; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Packages.MarkdownIt; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Prismjs; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor; |
|||
|
|||
[DependsOn( |
|||
typeof(HighlightJsScriptContributor), |
|||
typeof(CodemirrorScriptContributor), |
|||
typeof(MarkdownItScriptContributor) |
|||
typeof(PrismjsScriptBundleContributor) |
|||
)] |
|||
public class TuiEditorScriptContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/libs/tui-editor/toastui-editor.js"); |
|||
context.Files.AddIfNotContains("/libs/tui-editor/toastui-editor-all.min.js"); |
|||
context.Files.AddIfNotContains("/libs/tui-editor/toastui-editor-plugin-code-syntax-highlight-all.min.js"); |
|||
} |
|||
} |
|||
|
|||
@ -1,19 +1,18 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Codemirror; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Prismjs; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor; |
|||
|
|||
[DependsOn( |
|||
typeof(CodemirrorStyleContributor), |
|||
typeof(HighlightJsStyleContributor) |
|||
typeof(PrismjsStyleBundleContributor) |
|||
)] |
|||
public class TuiEditorStyleContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/libs/tui-editor/toastui-editor.css"); |
|||
context.Files.AddIfNotContains("/libs/tui-editor/toastui-editor.min.css"); |
|||
context.Files.AddIfNotContains("/libs/tui-editor/toastui-editor-plugin-code-syntax-highlight.min.css"); |
|||
} |
|||
} |
|||
|
|||
File diff suppressed because it is too large
@ -0,0 +1,66 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations |
|||
{ |
|||
public partial class User_IsActive : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpSettings_Name_ProviderName_ProviderKey", |
|||
table: "AbpSettings"); |
|||
|
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", |
|||
table: "AbpPermissionGrants"); |
|||
|
|||
migrationBuilder.AddColumn<bool>( |
|||
name: "IsActive", |
|||
table: "AbpUsers", |
|||
type: "bit", |
|||
nullable: false, |
|||
defaultValue: false); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpSettings_Name_ProviderName_ProviderKey", |
|||
table: "AbpSettings", |
|||
columns: new[] { "Name", "ProviderName", "ProviderKey" }, |
|||
unique: true, |
|||
filter: "[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey", |
|||
table: "AbpPermissionGrants", |
|||
columns: new[] { "TenantId", "Name", "ProviderName", "ProviderKey" }, |
|||
unique: true, |
|||
filter: "[TenantId] IS NOT NULL"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpSettings_Name_ProviderName_ProviderKey", |
|||
table: "AbpSettings"); |
|||
|
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey", |
|||
table: "AbpPermissionGrants"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "IsActive", |
|||
table: "AbpUsers"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpSettings_Name_ProviderName_ProviderKey", |
|||
table: "AbpSettings", |
|||
columns: new[] { "Name", "ProviderName", "ProviderKey" }); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", |
|||
table: "AbpPermissionGrants", |
|||
columns: new[] { "Name", "ProviderName", "ProviderKey" }); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,171 @@ |
|||
/*! |
|||
* TOAST UI Editor : Code Syntax Highlight Plugin |
|||
* @version 3.0.0 | Thu Jun 17 2021 |
|||
* @author NHN FE Development Lab <dl_javascript@nhn.com> |
|||
* @license MIT |
|||
*/ |
|||
/* prevent to create draggable box in IE with prism */ |
|||
pre[class*="language-"] { |
|||
overflow: visible; |
|||
} |
|||
|
|||
.toastui-editor-ww-code-block-highlighting { |
|||
position: relative; |
|||
} |
|||
|
|||
.toastui-editor-ww-code-block-highlighting:after { |
|||
content: attr(data-language); |
|||
position: absolute; |
|||
display: inline-block; |
|||
top: 10px; |
|||
right: 10px; |
|||
height: 24px; |
|||
padding: 3px 30px 0 10px; |
|||
font-weight: bold; |
|||
font-size: 13px; |
|||
color: #333; |
|||
background-color: #e5e9ea; |
|||
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMzAgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMwIDMwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzU1NTU1NTt9Cjwvc3R5bGU+CjxnPgoJPGc+CgkJPGc+CgkJCTxnPgoJCQkJPGc+CgkJCQkJPHBhdGggY2xhc3M9InN0MCIgZD0iTTE1LjUsMTIuNWwyLDJMMTIsMjBoLTJ2LTJMMTUuNSwxMi41eiBNMTgsMTBsMiwybC0xLjUsMS41bC0yLTJMMTgsMTB6Ii8+CgkJCQk8L2c+CgkJCTwvZz4KCQk8L2c+Cgk8L2c+CjwvZz4KPC9zdmc+Cg=='); |
|||
background-repeat: no-repeat; |
|||
background-position: right; |
|||
background-size: 30px 30px; |
|||
border-radius: 2px; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language { |
|||
position: fixed; |
|||
display: inline-block; |
|||
right: 35px; |
|||
z-index: 100; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input { |
|||
position: relative; |
|||
display: inline-block; |
|||
padding: 0 22px 0 10px; |
|||
width: 112px; |
|||
height: 26px; |
|||
border: 1px solid #ccc; |
|||
border-radius: 2px; |
|||
background-color: #fff; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input input { |
|||
margin: 0; |
|||
padding: 0; |
|||
height: 100%; |
|||
width: 100%; |
|||
background-color: #fff; |
|||
color: #222; |
|||
border: none; |
|||
outline: none; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input input::placeholder { |
|||
color: #ccc; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-input input::-ms-clear { |
|||
display: none; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language .toastui-editor-code-block-language-input::after { |
|||
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzIyMjIyMjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLWQtc2lkZSI+CgkJPHBvbHlnb24gaWQ9IlJlY3RhbmdsZS03IiBjbGFzcz0ic3QwIiBwb2ludHM9IjIsNSAxMCw1IDYsMTAgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); |
|||
position: absolute; |
|||
display: inline-block; |
|||
top: 7px; |
|||
right: 5px; |
|||
width: 12px; |
|||
height: 14px; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language.active .toastui-editor-code-block-language-input::after { |
|||
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6IzIyMjIyMjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLXVwLXNpZGUiPgoJCTxwb2x5Z29uIGlkPSJSZWN0YW5nbGUtNyIgY2xhc3M9InN0MCIgcG9pbnRzPSIyLDkgMTAsOSA2LDQgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list { |
|||
position: fixed; |
|||
margin-top: -1px; |
|||
width: 144px; |
|||
border: solid 1px #ccc; |
|||
border-bottom-left-radius: 2px; |
|||
border-bottom-right-radius: 2px; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list .buttons { |
|||
max-height: 169px; |
|||
overflow: auto; |
|||
padding: 0; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list button { |
|||
width: 100%; |
|||
background-color: #fff; |
|||
border: none; |
|||
outline: 0; |
|||
padding: 0 10px; |
|||
font-size: 13px; |
|||
line-height: 24px; |
|||
text-align: left; |
|||
color: #222; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list button.active { |
|||
color: #4b96e6; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.toastui-editor-code-block-language-list button:hover { |
|||
background-color: #f4f7f8; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-input input::placeholder { |
|||
color: #eee; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-ww-code-block-highlighting:after { |
|||
background-color: #232428; |
|||
border: 1px solid #393b42; |
|||
color: #eee; |
|||
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMzAgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMwIDMwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6I2ZmZjt9Cjwvc3R5bGU+CjxnPgoJPGc+CgkJPGc+CgkJCTxnPgoJCQkJPGc+CgkJCQkJPHBhdGggY2xhc3M9InN0MCIgZD0iTTE1LjUsMTIuNWwyLDJMMTIsMjBoLTJ2LTJMMTUuNSwxMi41eiBNMTgsMTBsMiwybC0xLjUsMS41bC0yLTJMMTgsMTB6Ii8+CgkJCQk8L2c+CgkJCTwvZz4KCQk8L2c+Cgk8L2c+CjwvZz4KPC9zdmc+Cg=='); |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language span { |
|||
border: 1px solid #494c56; |
|||
background-color: #121212; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language input { |
|||
background-color: #121212; |
|||
color: #eee; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list { |
|||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08); |
|||
border: 1px solid #494c56; |
|||
border-radius: 2px; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list button { |
|||
color: #eee; |
|||
background-color: #121212; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list button.active { |
|||
color: #4b96e6; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language-list button:hover { |
|||
background-color: #36383f; |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language .toastui-editor-code-block-language-input::after { |
|||
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6I2ZmZjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLWQtc2lkZSI+CgkJPHBvbHlnb24gaWQ9IlJlY3RhbmdsZS03IiBjbGFzcz0ic3QwIiBwb2ludHM9IjIsNSAxMCw1IDYsMTAgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); |
|||
} |
|||
|
|||
.toastui-editor-dark .toastui-editor-code-block-language.active .toastui-editor-code-block-language-input::after { |
|||
content: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuugiOydtOyWtF8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiCgkgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyIDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO2ZpbGw6I2ZmZjt9Cjwvc3R5bGU+CjxkZXNjPkNyZWF0ZWQgd2l0aCBza2V0Y2h0b29sLjwvZGVzYz4KPGcgaWQ9IlN5bWJvbHMiPgoJPGcgaWQ9ImNvbS10cmFuZ2xlLXVwLXNpZGUiPgoJCTxwb2x5Z29uIGlkPSJSZWN0YW5nbGUtNyIgY2xhc3M9InN0MCIgcG9pbnRzPSIyLDkgMTAsOSA2LDQgCQkiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K'); |
|||
} |
|||
@ -1,280 +0,0 @@ |
|||
/*! |
|||
* @toast-ui/editor |
|||
* @version 2.5.2 | Fri Apr 16 2021 |
|||
* @author NHN FE Development Lab <dl_javascript@nhn.com> |
|||
* @license MIT |
|||
*/ |
|||
@charset "utf-8"; |
|||
.CodeMirror { |
|||
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; |
|||
} |
|||
|
|||
.tui-editor-contents *:not(table) { |
|||
line-height: 160%; |
|||
box-sizing: content-box; |
|||
} |
|||
|
|||
.tui-editor-contents i, |
|||
.tui-editor-contents cite, |
|||
.tui-editor-contents em, |
|||
.tui-editor-contents var, |
|||
.tui-editor-contents address, |
|||
.tui-editor-contents dfn { |
|||
font-style: italic; |
|||
} |
|||
|
|||
.tui-editor-contents strong { |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.tui-editor-contents p { |
|||
margin: 10px 0; |
|||
color: #555; |
|||
} |
|||
|
|||
.tui-editor-contents > h1:first-of-type, |
|||
.tui-editor-contents > div > div:first-of-type h1 { |
|||
margin-top: 14px; |
|||
} |
|||
|
|||
.tui-editor-contents h1, |
|||
.tui-editor-contents h2, |
|||
.tui-editor-contents h3, |
|||
.tui-editor-contents h5 { |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.tui-editor-contents h1 { |
|||
font-size: 1.6rem; |
|||
line-height: 28px; |
|||
border-bottom: 3px double #999; |
|||
margin: 52px 0 15px 0; |
|||
padding-bottom: 7px; |
|||
color: #000; |
|||
} |
|||
|
|||
.tui-editor-contents h2 { |
|||
font-size: 1.3rem; |
|||
line-height: 23px; |
|||
border-bottom: 1px solid #dbdbdb; |
|||
margin: 30px 0 13px 0; |
|||
padding-bottom: 7px; |
|||
color: #333; |
|||
} |
|||
|
|||
.tui-editor-contents h3, |
|||
.tui-editor-contents h4 { |
|||
font-size: 1.2rem; |
|||
line-height: 18px; |
|||
margin: 20px 0 2px; |
|||
color: #333; |
|||
} |
|||
|
|||
.tui-editor-contents h5, |
|||
.tui-editor-contents h6 { |
|||
font-size: 1rem; |
|||
line-height: 17px; |
|||
margin: 10px 0 -4px; |
|||
color: #333; |
|||
} |
|||
|
|||
.tui-editor-contents blockquote { |
|||
margin: 15px 0; |
|||
} |
|||
|
|||
.tui-editor-contents blockquote { |
|||
border-left: 4px solid #dddddd; |
|||
padding: 0 15px; |
|||
color: #777777; |
|||
} |
|||
|
|||
.tui-editor-contents blockquote > :first-child { |
|||
margin-top: 0; |
|||
} |
|||
|
|||
.tui-editor-contents blockquote > :last-child { |
|||
margin-bottom: 0; |
|||
} |
|||
|
|||
.tui-editor-contents pre, |
|||
.tui-editor-contents code { |
|||
font-family: Consolas, Courier, 'Lucida Grande', '나눔바른고딕', 'Nanum Barun Gothic', '맑은고딕', |
|||
'Malgun Gothic', sans-serif; |
|||
border: 0; |
|||
border-radius: 0; |
|||
} |
|||
|
|||
.tui-editor-contents pre { |
|||
margin: 2px 0 8px; |
|||
padding: 18px; |
|||
background-color: #f5f7f8; |
|||
} |
|||
|
|||
.tui-editor-contents code { |
|||
color: #c1788b; |
|||
padding: 4px 4px 2px 0; |
|||
letter-spacing: -0.3px; |
|||
} |
|||
|
|||
.tui-editor-contents pre code { |
|||
padding: 0; |
|||
color: inherit; |
|||
white-space: pre-wrap; |
|||
background-color: transparent; |
|||
} |
|||
|
|||
.tui-editor-contents pre.addon { |
|||
border: 1px solid #e8ebed; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.tui-editor-contents img { |
|||
margin: 4px 0 10px; |
|||
box-sizing: border-box; |
|||
vertical-align: top; |
|||
max-width: 100%; |
|||
} |
|||
|
|||
.tui-editor-contents table { |
|||
margin: 2px 0 14px; |
|||
color: #555; |
|||
width: auto; |
|||
border-collapse: collapse; |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
.tui-editor-contents table th, |
|||
.tui-editor-contents table td { |
|||
height: 32px; |
|||
padding: 5px 14px 5px 12px; |
|||
} |
|||
|
|||
.tui-editor-contents table td { |
|||
border: 1px solid #eaeaea; |
|||
} |
|||
|
|||
.tui-editor-contents table th { |
|||
border: 1px solid #72777b; |
|||
border-top: 0; |
|||
background-color: #7b8184; |
|||
font-weight: 300; |
|||
color: #fff; |
|||
padding-top: 6px; |
|||
} |
|||
|
|||
.tui-editor-contents ul, |
|||
.tui-editor-contents menu, |
|||
.tui-editor-contents ol, |
|||
.tui-editor-contents dir { |
|||
display: block; |
|||
list-style-type: disc; |
|||
padding-left: 17px; |
|||
margin: 6px 0 10px; |
|||
color: #555; |
|||
} |
|||
|
|||
.tui-editor-contents ol { |
|||
list-style-type: decimal; |
|||
} |
|||
|
|||
.tui-editor-contents ul ul, |
|||
.tui-editor-contents ul ol, |
|||
.tui-editor-contents ol ol, |
|||
.tui-editor-contents ol ul { |
|||
margin-top: 0 !important; |
|||
margin-bottom: 0 !important; |
|||
} |
|||
|
|||
.tui-editor-contents ul li, |
|||
.tui-editor-contents ol li { |
|||
position: relative; |
|||
} |
|||
|
|||
.tui-editor-contents ul p, |
|||
ol p { |
|||
margin: 0; |
|||
} |
|||
|
|||
.tui-editor-contents ul li.task-list-item:before, |
|||
.tui-editor-contents ol li.task-list-item:before, |
|||
.tui-editor-contents pre ul li:before { |
|||
content: ''; |
|||
} |
|||
|
|||
.tui-editor-contents hr { |
|||
border-top: 1px solid #eee; |
|||
margin: 16px 0; |
|||
} |
|||
|
|||
.tui-editor-contents a { |
|||
text-decoration: underline; |
|||
color: #5286bc; |
|||
} |
|||
|
|||
.tui-editor-contents a:hover { |
|||
color: #007cff; |
|||
} |
|||
|
|||
.tui-editor-contents a.image-link { |
|||
position: relative; |
|||
} |
|||
|
|||
.tui-editor-contents a.image-link::before { |
|||
content: ''; |
|||
position: absolute; |
|||
margin: 0; |
|||
width: 20px; |
|||
height: 20px; |
|||
top: 2px; |
|||
right: 2px; |
|||
background-repeat: no-repeat; |
|||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAFKADAAQAAAABAAAAFAAAAACy3fD9AAAA/0lEQVQ4Ee2UIY6FQAyG/91wAQQJDg8SSwI3QIFAcQHuwFHQoOAEEFAELB6H4wIku+9vQgIP9zLyVbTTTufLtJ3MzzRNf1AoGlmu6ypBzvOMXyWkC+QLvDTjw6VM+Xr2OA6UZYmu67Dvu2zleX6zuq7D933EcQxNuyPu3usYYXVdw/M8mKYpIMMwxEZRJHbbNsmhkySJxE71APJmhGVZhnVdURQFlmU585GmKSzLEp+570Dlz+ZxQ/aGJVNYsm3bCIJA/LZtMY4jmqbBMAwIw1DiV/UAstEUltP3vawdxxFbVZVYDoWwM1eCp+LnoErIUt7DL/Ac1edWng1/WlXyD380myY5A34sAAAAAElFTkSuQmCC'); |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.tui-editor-contents { |
|||
font-size: 13px; |
|||
margin: 0; |
|||
padding: 0; |
|||
} |
|||
|
|||
.tui-editor-contents .task-list-item { |
|||
border: 0; |
|||
list-style: none; |
|||
padding-left: 22px; |
|||
margin-left: -22px; |
|||
min-height: 20px; |
|||
} |
|||
|
|||
.tui-editor-contents .task-list-item:before { |
|||
background-repeat: no-repeat; |
|||
background-size: 16px 16px; |
|||
background-position: center; |
|||
content: ''; |
|||
height: 18px; |
|||
width: 18px; |
|||
position: absolute; |
|||
left: 0; |
|||
top: 1px; |
|||
cursor: pointer; |
|||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAADdJREFUKBVjvHv37n8GMgALSI+SkhJJWu/du8fARJIOJMWjGpECA505GjjoIYLEB6dVUNojFQAA/1MJUFWet/4AAAAASUVORK5CYII='); |
|||
} |
|||
|
|||
.tui-editor-contents .task-list-item.checked:before { |
|||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMpJREFUKBVjjJ/64D8DGYCJDD1gLbTVyM3OxJDiJMzAxcYIdyALnIWDAdJU7i/OICfCxsDMxMgwc88bwk5F1vTs/W+GFUffwY2H+1FBlI2hLliCQYCbGSyJrqlzwwuGj9//YWoMtRBgUBJnZ6gMEGeQFWaFOw9kE7omkG5GWDyCPF7mJ86gIMbO8P//fwZGRkYGXJpAGuFO/fbrP0PXppcMD179JKgJRSOIA9N8/NZXrM4DqYEBjOgAaYYFOUwRNhruVGyS+MTI1ggAx8NTGcUtFVQAAAAASUVORK5CYII='); |
|||
} |
|||
|
|||
.tui-editor-contents .task-list-item input[type='checkbox'], |
|||
.tui-editor-contents .task-list-item .task-list-item-checkbox { |
|||
margin-left: -17px; |
|||
margin-right: 3.8px; |
|||
margin-top: 3px; |
|||
} |
|||
|
|||
.tui-editor-contents-placeholder:before { |
|||
content: attr(data-placeholder); |
|||
color: grey; |
|||
line-height: 160%; |
|||
position: absolute; |
|||
} |
|||
|
|||
@ -1,377 +0,0 @@ |
|||
/*! |
|||
* @toast-ui/editor |
|||
* @version 2.5.2 | Fri Apr 16 2021 |
|||
* @author NHN FE Development Lab <dl_javascript@nhn.com> |
|||
* @license MIT |
|||
*/ |
|||
@charset "utf-8"; |
|||
.tui-editor-contents { |
|||
margin: 0; |
|||
padding: 0; |
|||
font-size: 13px; |
|||
font-family: 'Open Sans', 'Helvetica Neue', 'Helvetica', 'Arial', '나눔바른고딕', |
|||
'Nanum Barun Gothic', '맑은고딕', 'Malgun Gothic', sans-serif; |
|||
} |
|||
|
|||
.tui-editor-contents *:not(table) { |
|||
line-height: 160%; |
|||
box-sizing: content-box; |
|||
} |
|||
|
|||
.tui-editor-contents i, |
|||
.tui-editor-contents cite, |
|||
.tui-editor-contents em, |
|||
.tui-editor-contents var, |
|||
.tui-editor-contents address, |
|||
.tui-editor-contents dfn { |
|||
font-style: italic; |
|||
} |
|||
|
|||
.tui-editor-contents strong { |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.tui-editor-contents p { |
|||
margin: 10px 0; |
|||
color: #222; |
|||
} |
|||
|
|||
.tui-editor-contents > h1:first-of-type, |
|||
.tui-editor-contents > div > div:first-of-type h1 { |
|||
margin-top: 14px; |
|||
} |
|||
|
|||
.tui-editor-contents h1, |
|||
.tui-editor-contents h2, |
|||
.tui-editor-contents h3, |
|||
.tui-editor-contents h4, |
|||
.tui-editor-contents h5, |
|||
.tui-editor-contents h6 { |
|||
font-weight: bold; |
|||
color: #222; |
|||
} |
|||
|
|||
.tui-editor-contents h1 { |
|||
font-size: 24px; |
|||
line-height: 28px; |
|||
border-bottom: 3px double #999; |
|||
margin: 52px 0 15px 0; |
|||
padding-bottom: 7px; |
|||
} |
|||
|
|||
.tui-editor-contents h2 { |
|||
font-size: 22px; |
|||
line-height: 23px; |
|||
border-bottom: 1px solid #dbdbdb; |
|||
margin: 20px 0 13px 0; |
|||
padding-bottom: 7px; |
|||
} |
|||
|
|||
.tui-editor-contents h3 { |
|||
font-size: 20px; |
|||
margin: 18px 0 2px; |
|||
} |
|||
|
|||
.tui-editor-contents h4 { |
|||
font-size: 18px; |
|||
margin: 10px 0 2px; |
|||
} |
|||
|
|||
.tui-editor-contents h3, |
|||
.tui-editor-contents h4 { |
|||
line-height: 18px; |
|||
} |
|||
|
|||
.tui-editor-contents h5 { |
|||
font-size: 16px; |
|||
} |
|||
|
|||
.tui-editor-contents h6 { |
|||
font-size: 14px; |
|||
} |
|||
|
|||
.tui-editor-contents h5, |
|||
.tui-editor-contents h6 { |
|||
line-height: 17px; |
|||
margin: 9px 0 -4px; |
|||
} |
|||
|
|||
.tui-editor-contents del { |
|||
color: #999; |
|||
} |
|||
|
|||
.tui-editor-contents blockquote { |
|||
margin: 14px 0; |
|||
border-left: 4px solid #e5e5e5; |
|||
padding: 0 16px; |
|||
color: #999; |
|||
} |
|||
|
|||
.tui-editor-contents blockquote p, |
|||
.tui-editor-contents blockquote ul, |
|||
.tui-editor-contents blockquote ol { |
|||
color: #999; |
|||
} |
|||
|
|||
.tui-editor-contents blockquote > :first-child { |
|||
margin-top: 0; |
|||
} |
|||
|
|||
.tui-editor-contents blockquote > :last-child { |
|||
margin-bottom: 0; |
|||
} |
|||
|
|||
.tui-editor-contents pre, |
|||
.tui-editor-contents code { |
|||
font-family: Consolas, Courier, 'Apple SD 산돌고딕 Neo', -apple-system, 'Lucida Grande', |
|||
'Apple SD Gothic Neo', '맑은 고딕', 'Malgun Gothic', 'Segoe UI', '돋움', dotum, sans-serif; |
|||
border: 0; |
|||
border-radius: 0; |
|||
} |
|||
|
|||
.tui-editor-contents pre { |
|||
margin: 2px 0 8px; |
|||
padding: 18px; |
|||
background-color: #f5f7f8; |
|||
} |
|||
|
|||
.tui-editor-contents code { |
|||
color: #c1798b; |
|||
background-color: #f9f2f4; |
|||
padding: 2px 3px; |
|||
letter-spacing: -0.3px; |
|||
border-radius: 2px; |
|||
} |
|||
|
|||
.tui-editor-contents pre code { |
|||
padding: 0; |
|||
color: inherit; |
|||
white-space: pre-wrap; |
|||
background-color: transparent; |
|||
} |
|||
|
|||
.tui-editor-contents pre.addon { |
|||
border: 1px solid #e8ebed; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.tui-editor-contents img { |
|||
margin: 4px 0 10px; |
|||
box-sizing: border-box; |
|||
vertical-align: top; |
|||
max-width: 100%; |
|||
} |
|||
|
|||
.tui-editor-contents table { |
|||
border: 1px solid rgba(0, 0, 0, 0.1); |
|||
margin: 12px 0 14px; |
|||
color: #222; |
|||
width: auto; |
|||
border-collapse: collapse; |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
.tui-editor-contents table th, |
|||
.tui-editor-contents table td { |
|||
border: 1px solid rgba(0, 0, 0, 0.1); |
|||
padding: 5px 14px 5px 12px; |
|||
height: 32px; |
|||
} |
|||
|
|||
.tui-editor-contents table th { |
|||
background-color: #555; |
|||
font-weight: 300; |
|||
color: #fff; |
|||
padding-top: 6px; |
|||
} |
|||
|
|||
.tui-editor-contents ul, |
|||
.tui-editor-contents menu, |
|||
.tui-editor-contents ol, |
|||
.tui-editor-contents dir { |
|||
display: block; |
|||
list-style-type: none; |
|||
padding-left: 24px; |
|||
margin: 6px 0 10px; |
|||
color: #222; |
|||
} |
|||
|
|||
.tui-editor-contents ol { |
|||
list-style-type: none; |
|||
counter-reset: li; |
|||
} |
|||
|
|||
.tui-editor-contents ol > li { |
|||
counter-increment: li; |
|||
} |
|||
|
|||
.tui-editor-contents ul > li::before, |
|||
.tui-editor-contents ol > li::before { |
|||
display: inline-block; |
|||
position: absolute; |
|||
} |
|||
|
|||
.tui-editor-contents ul > li::before { |
|||
content: ''; |
|||
margin-top: 6px; |
|||
margin-left: -17px; |
|||
width: 5px; |
|||
height: 5px; |
|||
border-radius: 50%; |
|||
background-color: #ccc; |
|||
} |
|||
|
|||
.tui-editor-contents ol > li::before { |
|||
content: '.' counter(li); |
|||
margin-left: -28px; |
|||
width: 24px; |
|||
text-align: right; |
|||
direction: rtl; |
|||
color: #aaa; |
|||
} |
|||
|
|||
.tui-editor-contents ul ul, |
|||
.tui-editor-contents ul ol, |
|||
.tui-editor-contents ol ol, |
|||
.tui-editor-contents ol ul { |
|||
margin-top: 0 !important; |
|||
margin-bottom: 0 !important; |
|||
} |
|||
|
|||
.tui-editor-contents ul li, |
|||
.tui-editor-contents ol li { |
|||
position: relative; |
|||
} |
|||
|
|||
.tui-editor-contents ul p, |
|||
.tui-editor-contents ol p { |
|||
margin: 0; |
|||
} |
|||
|
|||
.tui-editor-contents ul li.task-list-item::before, |
|||
.tui-editor-contents ol li.task-list-item::before, |
|||
.tui-editor-contents pre ul li::before { |
|||
content: ''; |
|||
} |
|||
|
|||
.tui-editor-contents th ol, |
|||
.tui-editor-contents th ul { |
|||
color: #fff; |
|||
} |
|||
|
|||
.tui-editor-contents hr { |
|||
border-top: 1px solid #eee; |
|||
margin: 16px 0; |
|||
} |
|||
|
|||
.tui-editor-contents a { |
|||
text-decoration: underline; |
|||
color: #4b96e6; |
|||
} |
|||
|
|||
.tui-editor-contents a:hover { |
|||
color: #1f70de; |
|||
} |
|||
|
|||
.tui-editor-contents a.image-link { |
|||
position: relative; |
|||
} |
|||
|
|||
.tui-editor-contents a.image-link::before { |
|||
content: ''; |
|||
position: absolute; |
|||
margin: 0; |
|||
width: 20px; |
|||
height: 20px; |
|||
top: 2px; |
|||
right: 2px; |
|||
background-repeat: no-repeat; |
|||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAFKADAAQAAAABAAAAFAAAAACy3fD9AAAA/0lEQVQ4Ee2UIY6FQAyG/91wAQQJDg8SSwI3QIFAcQHuwFHQoOAEEFAELB6H4wIku+9vQgIP9zLyVbTTTufLtJ3MzzRNf1AoGlmu6ypBzvOMXyWkC+QLvDTjw6VM+Xr2OA6UZYmu67Dvu2zleX6zuq7D933EcQxNuyPu3usYYXVdw/M8mKYpIMMwxEZRJHbbNsmhkySJxE71APJmhGVZhnVdURQFlmU585GmKSzLEp+570Dlz+ZxQ/aGJVNYsm3bCIJA/LZtMY4jmqbBMAwIw1DiV/UAstEUltP3vawdxxFbVZVYDoWwM1eCp+LnoErIUt7DL/Ac1edWng1/WlXyD380myY5A34sAAAAAElFTkSuQmCC'); |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.tui-editor-contents .task-list-item { |
|||
border: 0; |
|||
list-style: none; |
|||
padding-left: 24px; |
|||
margin-left: -24px; |
|||
} |
|||
|
|||
.tui-editor-contents .task-list-item::before { |
|||
background-repeat: no-repeat; |
|||
background-size: 18px 18px; |
|||
background-position: center; |
|||
content: ''; |
|||
margin-left: 0; |
|||
margin-top: 0; |
|||
border-radius: 0; |
|||
height: 18px; |
|||
width: 18px; |
|||
position: absolute; |
|||
left: 0; |
|||
top: 1px; |
|||
cursor: pointer; |
|||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAEqADAAQAAAABAAAAEgAAAACaqbJVAAAAQklEQVQ4EWM8c+bMfwYqABaQGcbGxhQZdfbsWQYmikxA0jxqEFJg4GCOhhGOgEESHg0jpMDAwRx8YQQuj0DlCaUAAEdBCPJ7TaEPAAAAAElFTkSuQmCC'); |
|||
} |
|||
|
|||
.tui-editor-contents .task-list-item.checked::before { |
|||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAEqADAAQAAAABAAAAEgAAAACaqbJVAAAA1ElEQVQ4EWP0nvbsPwMVABMVzAAbMWoQIiT5OJgYvLS5EAJQFguGCB4BkCHt/kIM8kKsYFXbrn6DqyY6sJENefjuN8ORuz/ghoAYWA0COR2kEQbQDanc+I7h049/MGkwjVANFQYZkmXHD/YCyABiDAFpxQgjkJO9dbjA4QAKDxAAhQnIO9hcAlYAJDBcBHIySANII8gAYgwBGYZhEEgQZFjVJohhhFwCUg8CjPgyLT8nE8N/YJZGD1iIVlQSI4yQpT9+R40ZZDl0NlavoSsihj/4DAIAR+hZHUj727YAAAAASUVORK5CYII='); |
|||
} |
|||
|
|||
.tui-editor-contents .task-list-item input[type='checkbox'], |
|||
.tui-editor-contents .task-list-item .task-list-item-checkbox { |
|||
margin-left: -17px; |
|||
margin-right: 3.8px; |
|||
margin-top: 3px; |
|||
} |
|||
|
|||
.tui-editor-contents-placeholder::before { |
|||
content: attr(data-placeholder); |
|||
color: grey; |
|||
line-height: 160%; |
|||
position: absolute; |
|||
} |
|||
|
|||
.te-preview .tui-editor-contents h1 { |
|||
min-height: 28px; |
|||
} |
|||
|
|||
.te-preview .tui-editor-contents h2 { |
|||
min-height: 23px; |
|||
} |
|||
|
|||
.te-preview .tui-editor-contents blockquote { |
|||
min-height: 20px; |
|||
} |
|||
|
|||
.te-preview .tui-editor-contents li { |
|||
min-height: 22px; |
|||
} |
|||
|
|||
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { |
|||
/* IE10+11 */ |
|||
.te-ww-container .tui-editor-contents li { |
|||
vertical-align: middle; |
|||
} |
|||
|
|||
.te-ww-container .tui-editor-contents ul > li::before, |
|||
.te-ww-container .tui-editor-contents ol > li::before, |
|||
.te-ww-container .tui-editor-contents .task-list-item:before { |
|||
position: static; |
|||
vertical-align: middle; |
|||
} |
|||
|
|||
.te-ww-container .tui-editor-contents ul > li::before { |
|||
margin-top: -3px; |
|||
margin-right: 12px; |
|||
} |
|||
|
|||
.te-ww-container .tui-editor-contents ol > li::before { |
|||
margin-right: 6px; |
|||
} |
|||
|
|||
.te-ww-container .tui-editor-contents .task-list-item { |
|||
padding-left: 2px; |
|||
} |
|||
} |
|||
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,59 +1,3 @@ |
|||
$(function(){ |
|||
var fileUploadUri = "/api/cms-kit-admin/media"; |
|||
var fileUriPrefix = "/api/cms-kit/media/" |
|||
|
|||
var editor = $('#content-editor'); |
|||
|
|||
function getUppyHeaders() { |
|||
var headers = {}; |
|||
headers[abp.security.antiForgery.tokenHeaderName] = abp.security.antiForgery.getToken(); |
|||
|
|||
return headers; |
|||
} |
|||
|
|||
var uploadImage = function (blob, callback, source) { |
|||
var UPPY_OPTIONS = { |
|||
endpoint: fileUploadUri, |
|||
formData: true, |
|||
fieldName: "file", |
|||
method: "post", |
|||
headers: getUppyHeaders() |
|||
}; |
|||
|
|||
var UPPY = Uppy.Core().use(Uppy.XHRUpload, UPPY_OPTIONS); |
|||
|
|||
UPPY.reset(); |
|||
|
|||
UPPY.addFile({ |
|||
id: "content-file", |
|||
name: blob.name, |
|||
type: blob.type, |
|||
data: blob, |
|||
}); |
|||
|
|||
UPPY.upload().then((result) => { |
|||
if (result.failed.length > 0) { |
|||
abp.message.error("File upload failed"); |
|||
} else { |
|||
var mediaDto = result.successful[0].response.body; |
|||
var fileUrl = (fileUriPrefix + mediaDto.id); |
|||
|
|||
callback(fileUrl, mediaDto.name); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
new toastui.Editor({ |
|||
el: editor[0], |
|||
usageStatistics: false, |
|||
useCommandShortcut: true, |
|||
initialEditType: 'wysiwyg', |
|||
previewStyle: 'tab', |
|||
height: "25em", |
|||
minHeight: "25em", |
|||
language: abp.localization.currentCulture.cultureName, |
|||
hooks: { |
|||
addImageBlobHook: uploadImage, |
|||
}, |
|||
}); |
|||
}); |
|||
}); |
|||
|
|||
@ -1,5 +1,5 @@ |
|||
{ |
|||
"ConnectionStrings": { |
|||
"Default": "Server=localhost;Database=CmsKit_Unified;Trusted_Connection=True" |
|||
"Default": "Server=(localdb)\\.\\MSSQLLocalDB;Database=CmsKit_Unified;Trusted_Connection=True" |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,973 @@ |
|||
/*! |
|||
* clipboard.js v2.0.6 |
|||
* https://clipboardjs.com/
|
|||
* |
|||
* Licensed MIT © Zeno Rocha |
|||
*/ |
|||
(function webpackUniversalModuleDefinition(root, factory) { |
|||
if(typeof exports === 'object' && typeof module === 'object') |
|||
module.exports = factory(); |
|||
else if(typeof define === 'function' && define.amd) |
|||
define([], factory); |
|||
else if(typeof exports === 'object') |
|||
exports["ClipboardJS"] = factory(); |
|||
else |
|||
root["ClipboardJS"] = factory(); |
|||
})(this, function() { |
|||
return /******/ (function(modules) { // webpackBootstrap
|
|||
/******/ // The module cache
|
|||
/******/ var installedModules = {}; |
|||
/******/ |
|||
/******/ // The require function
|
|||
/******/ function __webpack_require__(moduleId) { |
|||
/******/ |
|||
/******/ // Check if module is in cache
|
|||
/******/ if(installedModules[moduleId]) { |
|||
/******/ return installedModules[moduleId].exports; |
|||
/******/ } |
|||
/******/ // Create a new module (and put it into the cache)
|
|||
/******/ var module = installedModules[moduleId] = { |
|||
/******/ i: moduleId, |
|||
/******/ l: false, |
|||
/******/ exports: {} |
|||
/******/ }; |
|||
/******/ |
|||
/******/ // Execute the module function
|
|||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
|||
/******/ |
|||
/******/ // Flag the module as loaded
|
|||
/******/ module.l = true; |
|||
/******/ |
|||
/******/ // Return the exports of the module
|
|||
/******/ return module.exports; |
|||
/******/ } |
|||
/******/ |
|||
/******/ |
|||
/******/ // expose the modules object (__webpack_modules__)
|
|||
/******/ __webpack_require__.m = modules; |
|||
/******/ |
|||
/******/ // expose the module cache
|
|||
/******/ __webpack_require__.c = installedModules; |
|||
/******/ |
|||
/******/ // define getter function for harmony exports
|
|||
/******/ __webpack_require__.d = function(exports, name, getter) { |
|||
/******/ if(!__webpack_require__.o(exports, name)) { |
|||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); |
|||
/******/ } |
|||
/******/ }; |
|||
/******/ |
|||
/******/ // define __esModule on exports
|
|||
/******/ __webpack_require__.r = function(exports) { |
|||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
|||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
|||
/******/ } |
|||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
|||
/******/ }; |
|||
/******/ |
|||
/******/ // create a fake namespace object
|
|||
/******/ // mode & 1: value is a module id, require it
|
|||
/******/ // mode & 2: merge all properties of value into the ns
|
|||
/******/ // mode & 4: return value when already ns object
|
|||
/******/ // mode & 8|1: behave like require
|
|||
/******/ __webpack_require__.t = function(value, mode) { |
|||
/******/ if(mode & 1) value = __webpack_require__(value); |
|||
/******/ if(mode & 8) return value; |
|||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; |
|||
/******/ var ns = Object.create(null); |
|||
/******/ __webpack_require__.r(ns); |
|||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); |
|||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); |
|||
/******/ return ns; |
|||
/******/ }; |
|||
/******/ |
|||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|||
/******/ __webpack_require__.n = function(module) { |
|||
/******/ var getter = module && module.__esModule ? |
|||
/******/ function getDefault() { return module['default']; } : |
|||
/******/ function getModuleExports() { return module; }; |
|||
/******/ __webpack_require__.d(getter, 'a', getter); |
|||
/******/ return getter; |
|||
/******/ }; |
|||
/******/ |
|||
/******/ // Object.prototype.hasOwnProperty.call
|
|||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; |
|||
/******/ |
|||
/******/ // __webpack_public_path__
|
|||
/******/ __webpack_require__.p = ""; |
|||
/******/ |
|||
/******/ |
|||
/******/ // Load entry module and return exports
|
|||
/******/ return __webpack_require__(__webpack_require__.s = 6); |
|||
/******/ }) |
|||
/************************************************************************/ |
|||
/******/ ([ |
|||
/* 0 */ |
|||
/***/ (function(module, exports) { |
|||
|
|||
function select(element) { |
|||
var selectedText; |
|||
|
|||
if (element.nodeName === 'SELECT') { |
|||
element.focus(); |
|||
|
|||
selectedText = element.value; |
|||
} |
|||
else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') { |
|||
var isReadOnly = element.hasAttribute('readonly'); |
|||
|
|||
if (!isReadOnly) { |
|||
element.setAttribute('readonly', ''); |
|||
} |
|||
|
|||
element.select(); |
|||
element.setSelectionRange(0, element.value.length); |
|||
|
|||
if (!isReadOnly) { |
|||
element.removeAttribute('readonly'); |
|||
} |
|||
|
|||
selectedText = element.value; |
|||
} |
|||
else { |
|||
if (element.hasAttribute('contenteditable')) { |
|||
element.focus(); |
|||
} |
|||
|
|||
var selection = window.getSelection(); |
|||
var range = document.createRange(); |
|||
|
|||
range.selectNodeContents(element); |
|||
selection.removeAllRanges(); |
|||
selection.addRange(range); |
|||
|
|||
selectedText = selection.toString(); |
|||
} |
|||
|
|||
return selectedText; |
|||
} |
|||
|
|||
module.exports = select; |
|||
|
|||
|
|||
/***/ }), |
|||
/* 1 */ |
|||
/***/ (function(module, exports) { |
|||
|
|||
function E () { |
|||
// Keep this empty so it's easier to inherit from
|
|||
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
|
|||
} |
|||
|
|||
E.prototype = { |
|||
on: function (name, callback, ctx) { |
|||
var e = this.e || (this.e = {}); |
|||
|
|||
(e[name] || (e[name] = [])).push({ |
|||
fn: callback, |
|||
ctx: ctx |
|||
}); |
|||
|
|||
return this; |
|||
}, |
|||
|
|||
once: function (name, callback, ctx) { |
|||
var self = this; |
|||
function listener () { |
|||
self.off(name, listener); |
|||
callback.apply(ctx, arguments); |
|||
}; |
|||
|
|||
listener._ = callback |
|||
return this.on(name, listener, ctx); |
|||
}, |
|||
|
|||
emit: function (name) { |
|||
var data = [].slice.call(arguments, 1); |
|||
var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); |
|||
var i = 0; |
|||
var len = evtArr.length; |
|||
|
|||
for (i; i < len; i++) { |
|||
evtArr[i].fn.apply(evtArr[i].ctx, data); |
|||
} |
|||
|
|||
return this; |
|||
}, |
|||
|
|||
off: function (name, callback) { |
|||
var e = this.e || (this.e = {}); |
|||
var evts = e[name]; |
|||
var liveEvents = []; |
|||
|
|||
if (evts && callback) { |
|||
for (var i = 0, len = evts.length; i < len; i++) { |
|||
if (evts[i].fn !== callback && evts[i].fn._ !== callback) |
|||
liveEvents.push(evts[i]); |
|||
} |
|||
} |
|||
|
|||
// Remove event from queue to prevent memory leak
|
|||
// Suggested by https://github.com/lazd
|
|||
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
|
|||
|
|||
(liveEvents.length) |
|||
? e[name] = liveEvents |
|||
: delete e[name]; |
|||
|
|||
return this; |
|||
} |
|||
}; |
|||
|
|||
module.exports = E; |
|||
module.exports.TinyEmitter = E; |
|||
|
|||
|
|||
/***/ }), |
|||
/* 2 */ |
|||
/***/ (function(module, exports, __webpack_require__) { |
|||
|
|||
var is = __webpack_require__(3); |
|||
var delegate = __webpack_require__(4); |
|||
|
|||
/** |
|||
* Validates all params and calls the right |
|||
* listener function based on its target type. |
|||
* |
|||
* @param {String|HTMLElement|HTMLCollection|NodeList} target |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @return {Object} |
|||
*/ |
|||
function listen(target, type, callback) { |
|||
if (!target && !type && !callback) { |
|||
throw new Error('Missing required arguments'); |
|||
} |
|||
|
|||
if (!is.string(type)) { |
|||
throw new TypeError('Second argument must be a String'); |
|||
} |
|||
|
|||
if (!is.fn(callback)) { |
|||
throw new TypeError('Third argument must be a Function'); |
|||
} |
|||
|
|||
if (is.node(target)) { |
|||
return listenNode(target, type, callback); |
|||
} |
|||
else if (is.nodeList(target)) { |
|||
return listenNodeList(target, type, callback); |
|||
} |
|||
else if (is.string(target)) { |
|||
return listenSelector(target, type, callback); |
|||
} |
|||
else { |
|||
throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList'); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Adds an event listener to a HTML element |
|||
* and returns a remove listener function. |
|||
* |
|||
* @param {HTMLElement} node |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @return {Object} |
|||
*/ |
|||
function listenNode(node, type, callback) { |
|||
node.addEventListener(type, callback); |
|||
|
|||
return { |
|||
destroy: function() { |
|||
node.removeEventListener(type, callback); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Add an event listener to a list of HTML elements |
|||
* and returns a remove listener function. |
|||
* |
|||
* @param {NodeList|HTMLCollection} nodeList |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @return {Object} |
|||
*/ |
|||
function listenNodeList(nodeList, type, callback) { |
|||
Array.prototype.forEach.call(nodeList, function(node) { |
|||
node.addEventListener(type, callback); |
|||
}); |
|||
|
|||
return { |
|||
destroy: function() { |
|||
Array.prototype.forEach.call(nodeList, function(node) { |
|||
node.removeEventListener(type, callback); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Add an event listener to a selector |
|||
* and returns a remove listener function. |
|||
* |
|||
* @param {String} selector |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @return {Object} |
|||
*/ |
|||
function listenSelector(selector, type, callback) { |
|||
return delegate(document.body, selector, type, callback); |
|||
} |
|||
|
|||
module.exports = listen; |
|||
|
|||
|
|||
/***/ }), |
|||
/* 3 */ |
|||
/***/ (function(module, exports) { |
|||
|
|||
/** |
|||
* Check if argument is a HTML element. |
|||
* |
|||
* @param {Object} value |
|||
* @return {Boolean} |
|||
*/ |
|||
exports.node = function(value) { |
|||
return value !== undefined |
|||
&& value instanceof HTMLElement |
|||
&& value.nodeType === 1; |
|||
}; |
|||
|
|||
/** |
|||
* Check if argument is a list of HTML elements. |
|||
* |
|||
* @param {Object} value |
|||
* @return {Boolean} |
|||
*/ |
|||
exports.nodeList = function(value) { |
|||
var type = Object.prototype.toString.call(value); |
|||
|
|||
return value !== undefined |
|||
&& (type === '[object NodeList]' || type === '[object HTMLCollection]') |
|||
&& ('length' in value) |
|||
&& (value.length === 0 || exports.node(value[0])); |
|||
}; |
|||
|
|||
/** |
|||
* Check if argument is a string. |
|||
* |
|||
* @param {Object} value |
|||
* @return {Boolean} |
|||
*/ |
|||
exports.string = function(value) { |
|||
return typeof value === 'string' |
|||
|| value instanceof String; |
|||
}; |
|||
|
|||
/** |
|||
* Check if argument is a function. |
|||
* |
|||
* @param {Object} value |
|||
* @return {Boolean} |
|||
*/ |
|||
exports.fn = function(value) { |
|||
var type = Object.prototype.toString.call(value); |
|||
|
|||
return type === '[object Function]'; |
|||
}; |
|||
|
|||
|
|||
/***/ }), |
|||
/* 4 */ |
|||
/***/ (function(module, exports, __webpack_require__) { |
|||
|
|||
var closest = __webpack_require__(5); |
|||
|
|||
/** |
|||
* Delegates event to a selector. |
|||
* |
|||
* @param {Element} element |
|||
* @param {String} selector |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @param {Boolean} useCapture |
|||
* @return {Object} |
|||
*/ |
|||
function _delegate(element, selector, type, callback, useCapture) { |
|||
var listenerFn = listener.apply(this, arguments); |
|||
|
|||
element.addEventListener(type, listenerFn, useCapture); |
|||
|
|||
return { |
|||
destroy: function() { |
|||
element.removeEventListener(type, listenerFn, useCapture); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Delegates event to a selector. |
|||
* |
|||
* @param {Element|String|Array} [elements] |
|||
* @param {String} selector |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @param {Boolean} useCapture |
|||
* @return {Object} |
|||
*/ |
|||
function delegate(elements, selector, type, callback, useCapture) { |
|||
// Handle the regular Element usage
|
|||
if (typeof elements.addEventListener === 'function') { |
|||
return _delegate.apply(null, arguments); |
|||
} |
|||
|
|||
// Handle Element-less usage, it defaults to global delegation
|
|||
if (typeof type === 'function') { |
|||
// Use `document` as the first parameter, then apply arguments
|
|||
// This is a short way to .unshift `arguments` without running into deoptimizations
|
|||
return _delegate.bind(null, document).apply(null, arguments); |
|||
} |
|||
|
|||
// Handle Selector-based usage
|
|||
if (typeof elements === 'string') { |
|||
elements = document.querySelectorAll(elements); |
|||
} |
|||
|
|||
// Handle Array-like based usage
|
|||
return Array.prototype.map.call(elements, function (element) { |
|||
return _delegate(element, selector, type, callback, useCapture); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Finds closest match and invokes callback. |
|||
* |
|||
* @param {Element} element |
|||
* @param {String} selector |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @return {Function} |
|||
*/ |
|||
function listener(element, selector, type, callback) { |
|||
return function(e) { |
|||
e.delegateTarget = closest(e.target, selector); |
|||
|
|||
if (e.delegateTarget) { |
|||
callback.call(element, e); |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = delegate; |
|||
|
|||
|
|||
/***/ }), |
|||
/* 5 */ |
|||
/***/ (function(module, exports) { |
|||
|
|||
var DOCUMENT_NODE_TYPE = 9; |
|||
|
|||
/** |
|||
* A polyfill for Element.matches() |
|||
*/ |
|||
if (typeof Element !== 'undefined' && !Element.prototype.matches) { |
|||
var proto = Element.prototype; |
|||
|
|||
proto.matches = proto.matchesSelector || |
|||
proto.mozMatchesSelector || |
|||
proto.msMatchesSelector || |
|||
proto.oMatchesSelector || |
|||
proto.webkitMatchesSelector; |
|||
} |
|||
|
|||
/** |
|||
* Finds the closest parent that matches a selector. |
|||
* |
|||
* @param {Element} element |
|||
* @param {String} selector |
|||
* @return {Function} |
|||
*/ |
|||
function closest (element, selector) { |
|||
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) { |
|||
if (typeof element.matches === 'function' && |
|||
element.matches(selector)) { |
|||
return element; |
|||
} |
|||
element = element.parentNode; |
|||
} |
|||
} |
|||
|
|||
module.exports = closest; |
|||
|
|||
|
|||
/***/ }), |
|||
/* 6 */ |
|||
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|||
|
|||
"use strict"; |
|||
__webpack_require__.r(__webpack_exports__); |
|||
|
|||
// EXTERNAL MODULE: ./node_modules/select/src/select.js
|
|||
var src_select = __webpack_require__(0); |
|||
var select_default = /*#__PURE__*/__webpack_require__.n(src_select); |
|||
|
|||
// CONCATENATED MODULE: ./src/clipboard-action.js
|
|||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; |
|||
|
|||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
|||
|
|||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
|||
|
|||
|
|||
|
|||
/** |
|||
* Inner class which performs selection from either `text` or `target` |
|||
* properties and then executes copy or cut operations. |
|||
*/ |
|||
|
|||
var clipboard_action_ClipboardAction = function () { |
|||
/** |
|||
* @param {Object} options |
|||
*/ |
|||
function ClipboardAction(options) { |
|||
_classCallCheck(this, ClipboardAction); |
|||
|
|||
this.resolveOptions(options); |
|||
this.initSelection(); |
|||
} |
|||
|
|||
/** |
|||
* Defines base properties passed from constructor. |
|||
* @param {Object} options |
|||
*/ |
|||
|
|||
|
|||
_createClass(ClipboardAction, [{ |
|||
key: 'resolveOptions', |
|||
value: function resolveOptions() { |
|||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|||
|
|||
this.action = options.action; |
|||
this.container = options.container; |
|||
this.emitter = options.emitter; |
|||
this.target = options.target; |
|||
this.text = options.text; |
|||
this.trigger = options.trigger; |
|||
|
|||
this.selectedText = ''; |
|||
} |
|||
|
|||
/** |
|||
* Decides which selection strategy is going to be applied based |
|||
* on the existence of `text` and `target` properties. |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'initSelection', |
|||
value: function initSelection() { |
|||
if (this.text) { |
|||
this.selectFake(); |
|||
} else if (this.target) { |
|||
this.selectTarget(); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Creates a fake textarea element, sets its value from `text` property, |
|||
* and makes a selection on it. |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'selectFake', |
|||
value: function selectFake() { |
|||
var _this = this; |
|||
|
|||
var isRTL = document.documentElement.getAttribute('dir') == 'rtl'; |
|||
|
|||
this.removeFake(); |
|||
|
|||
this.fakeHandlerCallback = function () { |
|||
return _this.removeFake(); |
|||
}; |
|||
this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true; |
|||
|
|||
this.fakeElem = document.createElement('textarea'); |
|||
// Prevent zooming on iOS
|
|||
this.fakeElem.style.fontSize = '12pt'; |
|||
// Reset box model
|
|||
this.fakeElem.style.border = '0'; |
|||
this.fakeElem.style.padding = '0'; |
|||
this.fakeElem.style.margin = '0'; |
|||
// Move element out of screen horizontally
|
|||
this.fakeElem.style.position = 'absolute'; |
|||
this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px'; |
|||
// Move element to the same position vertically
|
|||
var yPosition = window.pageYOffset || document.documentElement.scrollTop; |
|||
this.fakeElem.style.top = yPosition + 'px'; |
|||
|
|||
this.fakeElem.setAttribute('readonly', ''); |
|||
this.fakeElem.value = this.text; |
|||
|
|||
this.container.appendChild(this.fakeElem); |
|||
|
|||
this.selectedText = select_default()(this.fakeElem); |
|||
this.copyText(); |
|||
} |
|||
|
|||
/** |
|||
* Only removes the fake element after another click event, that way |
|||
* a user can hit `Ctrl+C` to copy because selection still exists. |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'removeFake', |
|||
value: function removeFake() { |
|||
if (this.fakeHandler) { |
|||
this.container.removeEventListener('click', this.fakeHandlerCallback); |
|||
this.fakeHandler = null; |
|||
this.fakeHandlerCallback = null; |
|||
} |
|||
|
|||
if (this.fakeElem) { |
|||
this.container.removeChild(this.fakeElem); |
|||
this.fakeElem = null; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Selects the content from element passed on `target` property. |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'selectTarget', |
|||
value: function selectTarget() { |
|||
this.selectedText = select_default()(this.target); |
|||
this.copyText(); |
|||
} |
|||
|
|||
/** |
|||
* Executes the copy operation based on the current selection. |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'copyText', |
|||
value: function copyText() { |
|||
var succeeded = void 0; |
|||
|
|||
try { |
|||
succeeded = document.execCommand(this.action); |
|||
} catch (err) { |
|||
succeeded = false; |
|||
} |
|||
|
|||
this.handleResult(succeeded); |
|||
} |
|||
|
|||
/** |
|||
* Fires an event based on the copy operation result. |
|||
* @param {Boolean} succeeded |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'handleResult', |
|||
value: function handleResult(succeeded) { |
|||
this.emitter.emit(succeeded ? 'success' : 'error', { |
|||
action: this.action, |
|||
text: this.selectedText, |
|||
trigger: this.trigger, |
|||
clearSelection: this.clearSelection.bind(this) |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Moves focus away from `target` and back to the trigger, removes current selection. |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'clearSelection', |
|||
value: function clearSelection() { |
|||
if (this.trigger) { |
|||
this.trigger.focus(); |
|||
} |
|||
document.activeElement.blur(); |
|||
window.getSelection().removeAllRanges(); |
|||
} |
|||
|
|||
/** |
|||
* Sets the `action` to be performed which can be either 'copy' or 'cut'. |
|||
* @param {String} action |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'destroy', |
|||
|
|||
|
|||
/** |
|||
* Destroy lifecycle. |
|||
*/ |
|||
value: function destroy() { |
|||
this.removeFake(); |
|||
} |
|||
}, { |
|||
key: 'action', |
|||
set: function set() { |
|||
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy'; |
|||
|
|||
this._action = action; |
|||
|
|||
if (this._action !== 'copy' && this._action !== 'cut') { |
|||
throw new Error('Invalid "action" value, use either "copy" or "cut"'); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Gets the `action` property. |
|||
* @return {String} |
|||
*/ |
|||
, |
|||
get: function get() { |
|||
return this._action; |
|||
} |
|||
|
|||
/** |
|||
* Sets the `target` property using an element |
|||
* that will be have its content copied. |
|||
* @param {Element} target |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'target', |
|||
set: function set(target) { |
|||
if (target !== undefined) { |
|||
if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) { |
|||
if (this.action === 'copy' && target.hasAttribute('disabled')) { |
|||
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); |
|||
} |
|||
|
|||
if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { |
|||
throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); |
|||
} |
|||
|
|||
this._target = target; |
|||
} else { |
|||
throw new Error('Invalid "target" value, use a valid Element'); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Gets the `target` property. |
|||
* @return {String|HTMLElement} |
|||
*/ |
|||
, |
|||
get: function get() { |
|||
return this._target; |
|||
} |
|||
}]); |
|||
|
|||
return ClipboardAction; |
|||
}(); |
|||
|
|||
/* harmony default export */ var clipboard_action = (clipboard_action_ClipboardAction); |
|||
// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
|
|||
var tiny_emitter = __webpack_require__(1); |
|||
var tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter); |
|||
|
|||
// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js
|
|||
var listen = __webpack_require__(2); |
|||
var listen_default = /*#__PURE__*/__webpack_require__.n(listen); |
|||
|
|||
// CONCATENATED MODULE: ./src/clipboard.js
|
|||
var clipboard_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; |
|||
|
|||
var clipboard_createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
|||
|
|||
function clipboard_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
|||
|
|||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
|||
|
|||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* Base class which takes one or more elements, adds event listeners to them, |
|||
* and instantiates a new `ClipboardAction` on each click. |
|||
*/ |
|||
|
|||
var clipboard_Clipboard = function (_Emitter) { |
|||
_inherits(Clipboard, _Emitter); |
|||
|
|||
/** |
|||
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger |
|||
* @param {Object} options |
|||
*/ |
|||
function Clipboard(trigger, options) { |
|||
clipboard_classCallCheck(this, Clipboard); |
|||
|
|||
var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this)); |
|||
|
|||
_this.resolveOptions(options); |
|||
_this.listenClick(trigger); |
|||
return _this; |
|||
} |
|||
|
|||
/** |
|||
* Defines if attributes would be resolved using internal setter functions |
|||
* or custom functions that were passed in the constructor. |
|||
* @param {Object} options |
|||
*/ |
|||
|
|||
|
|||
clipboard_createClass(Clipboard, [{ |
|||
key: 'resolveOptions', |
|||
value: function resolveOptions() { |
|||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|||
|
|||
this.action = typeof options.action === 'function' ? options.action : this.defaultAction; |
|||
this.target = typeof options.target === 'function' ? options.target : this.defaultTarget; |
|||
this.text = typeof options.text === 'function' ? options.text : this.defaultText; |
|||
this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body; |
|||
} |
|||
|
|||
/** |
|||
* Adds a click event listener to the passed trigger. |
|||
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'listenClick', |
|||
value: function listenClick(trigger) { |
|||
var _this2 = this; |
|||
|
|||
this.listener = listen_default()(trigger, 'click', function (e) { |
|||
return _this2.onClick(e); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Defines a new `ClipboardAction` on each click event. |
|||
* @param {Event} e |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'onClick', |
|||
value: function onClick(e) { |
|||
var trigger = e.delegateTarget || e.currentTarget; |
|||
|
|||
if (this.clipboardAction) { |
|||
this.clipboardAction = null; |
|||
} |
|||
|
|||
this.clipboardAction = new clipboard_action({ |
|||
action: this.action(trigger), |
|||
target: this.target(trigger), |
|||
text: this.text(trigger), |
|||
container: this.container, |
|||
trigger: trigger, |
|||
emitter: this |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Default `action` lookup function. |
|||
* @param {Element} trigger |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'defaultAction', |
|||
value: function defaultAction(trigger) { |
|||
return getAttributeValue('action', trigger); |
|||
} |
|||
|
|||
/** |
|||
* Default `target` lookup function. |
|||
* @param {Element} trigger |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'defaultTarget', |
|||
value: function defaultTarget(trigger) { |
|||
var selector = getAttributeValue('target', trigger); |
|||
|
|||
if (selector) { |
|||
return document.querySelector(selector); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Returns the support of the given action, or all actions if no action is |
|||
* given. |
|||
* @param {String} [action] |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'defaultText', |
|||
|
|||
|
|||
/** |
|||
* Default `text` lookup function. |
|||
* @param {Element} trigger |
|||
*/ |
|||
value: function defaultText(trigger) { |
|||
return getAttributeValue('text', trigger); |
|||
} |
|||
|
|||
/** |
|||
* Destroy lifecycle. |
|||
*/ |
|||
|
|||
}, { |
|||
key: 'destroy', |
|||
value: function destroy() { |
|||
this.listener.destroy(); |
|||
|
|||
if (this.clipboardAction) { |
|||
this.clipboardAction.destroy(); |
|||
this.clipboardAction = null; |
|||
} |
|||
} |
|||
}], [{ |
|||
key: 'isSupported', |
|||
value: function isSupported() { |
|||
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; |
|||
|
|||
var actions = typeof action === 'string' ? [action] : action; |
|||
var support = !!document.queryCommandSupported; |
|||
|
|||
actions.forEach(function (action) { |
|||
support = support && !!document.queryCommandSupported(action); |
|||
}); |
|||
|
|||
return support; |
|||
} |
|||
}]); |
|||
|
|||
return Clipboard; |
|||
}(tiny_emitter_default.a); |
|||
|
|||
/** |
|||
* Helper function to retrieve attribute value. |
|||
* @param {String} suffix |
|||
* @param {Element} element |
|||
*/ |
|||
|
|||
|
|||
function getAttributeValue(suffix, element) { |
|||
var attribute = 'data-clipboard-' + suffix; |
|||
|
|||
if (!element.hasAttribute(attribute)) { |
|||
return; |
|||
} |
|||
|
|||
return element.getAttribute(attribute); |
|||
} |
|||
|
|||
/* harmony default export */ var clipboard = __webpack_exports__["default"] = (clipboard_Clipboard); |
|||
|
|||
/***/ }) |
|||
/******/ ])["default"]; |
|||
}); |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
@ -0,0 +1,31 @@ |
|||
# [Prism](https://prismjs.com/) |
|||
|
|||
[](https://travis-ci.org/PrismJS/prism) |
|||
[](https://www.npmjs.com/package/prismjs) |
|||
|
|||
Prism is a lightweight, robust, elegant syntax highlighting library. It's a spin-off project from [Dabblet](https://dabblet.com/). |
|||
|
|||
You can learn more on [prismjs.com](https://prismjs.com/). |
|||
|
|||
[Why another syntax highlighter?](https://lea.verou.me/2012/07/introducing-prism-an-awesome-new-syntax-highlighter/#more-1841) |
|||
|
|||
[More themes for Prism!](https://github.com/PrismJS/prism-themes) |
|||
|
|||
## Contribute to Prism! |
|||
|
|||
Prism depends on community contributions to expand and cover a wider array of use cases. If you like it, considering giving back by sending a pull request. Here are a few tips: |
|||
|
|||
- Read the [documentation](https://prismjs.com/extending.html). Prism was designed to be extensible. |
|||
- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. The minified files are also generated automatically. |
|||
- The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. Having gulp installed, you just need to run the command `gulp`. |
|||
- Please follow the code conventions used in the files already. For example, I use [tabs for indentation and spaces for alignment](http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/). Opening braces are on the same line, closing braces on their own line regardless of construct. There is a space before the opening brace. etc etc. |
|||
- Please try to err towards more smaller PRs rather than few huge PRs. If a PR includes changes I want to merge and changes I don't, handling it becomes difficult. |
|||
- My time is very limited these days, so it might take a long time to review longer PRs (short ones are usually merged very quickly), especially those modifying the Prism Core. This doesn't mean your PR is rejected. |
|||
- If you contribute a new language definition, you will be responsible for handling bug reports about that language definition. |
|||
- If you add a new language definition, theme or plugin, you need to add it to `components.json` as well and rebuild Prism by running `gulp`, so that it becomes available to the download build page. For new languages, please also add a few [tests](https://prismjs.com/test-suite.html) and an example in the `examples/` folder. |
|||
|
|||
Thank you so much for contributing!! |
|||
|
|||
## Translations |
|||
|
|||
* [](https://www.awesomes.cn/repo/PrismJS/prism) |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
@ -0,0 +1,56 @@ |
|||
const components = require('../components.js'); |
|||
const getLoader = require('../dependencies'); |
|||
|
|||
|
|||
/** |
|||
* The set of all languages which have been loaded using the below function. |
|||
* |
|||
* @type {Set<string>} |
|||
*/ |
|||
const loadedLanguages = new Set(); |
|||
|
|||
/** |
|||
* Loads the given languages and adds them to the current Prism instance. |
|||
* |
|||
* If no languages are provided, __all__ Prism languages will be loaded. |
|||
* |
|||
* @param {string|string[]} [languages] |
|||
* @returns {void} |
|||
*/ |
|||
function loadLanguages(languages) { |
|||
if (languages === undefined) { |
|||
languages = Object.keys(components.languages).filter(l => l != 'meta'); |
|||
} else if (!Array.isArray(languages)) { |
|||
languages = [languages]; |
|||
} |
|||
|
|||
// the user might have loaded languages via some other way or used `prism.js` which already includes some
|
|||
// we don't need to validate the ids because `getLoader` will ignore invalid ones
|
|||
const loaded = [...loadedLanguages, ...Object.keys(Prism.languages)]; |
|||
|
|||
getLoader(components, languages, loaded).load(lang => { |
|||
if (!(lang in components.languages)) { |
|||
if (!loadLanguages.silent) { |
|||
console.warn('Language does not exist: ' + lang); |
|||
} |
|||
return; |
|||
} |
|||
|
|||
const pathToLanguage = './prism-' + lang; |
|||
|
|||
// remove from require cache and from Prism
|
|||
delete require.cache[require.resolve(pathToLanguage)]; |
|||
delete Prism.languages[lang]; |
|||
|
|||
require(pathToLanguage); |
|||
|
|||
loadedLanguages.add(lang); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Set this to `true` to prevent all warning messages `loadLanguages` logs. |
|||
*/ |
|||
loadLanguages.silent = false; |
|||
|
|||
module.exports = loadLanguages; |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,54 @@ |
|||
(function (Prism) { |
|||
|
|||
var coreRules = '(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)'; |
|||
|
|||
Prism.languages.abnf = { |
|||
'comment': /;.*/, |
|||
'string': { |
|||
pattern: /(?:%[is])?"[^"\n\r]*"/, |
|||
greedy: true, |
|||
inside: { |
|||
'punctuation': /^%[is]/ |
|||
} |
|||
}, |
|||
'range': { |
|||
pattern: /%(?:b[01]+-[01]+|d\d+-\d+|x[A-F\d]+-[A-F\d]+)/i, |
|||
alias: 'number' |
|||
}, |
|||
'terminal': { |
|||
pattern: /%(?:b[01]+(?:\.[01]+)*|d\d+(?:\.\d+)*|x[A-F\d]+(?:\.[A-F\d]+)*)/i, |
|||
alias: 'number' |
|||
}, |
|||
'repetition': { |
|||
pattern: /(^|[^\w-])(?:\d*\*\d*|\d+)/, |
|||
lookbehind: true, |
|||
alias: 'operator' |
|||
}, |
|||
'definition': { |
|||
pattern: /(^[ \t]*)(?:[a-z][\w-]*|<[^>\r\n]*>)(?=\s*=)/m, |
|||
lookbehind: true, |
|||
alias: 'keyword', |
|||
inside: { |
|||
'punctuation': /<|>/ |
|||
} |
|||
}, |
|||
'core-rule': { |
|||
pattern: RegExp('(?:(^|[^<\\w-])' + coreRules + '|<' + coreRules + '>)(?![\\w-])', 'i'), |
|||
lookbehind: true, |
|||
alias: ['rule', 'constant'], |
|||
inside: { |
|||
'punctuation': /<|>/ |
|||
} |
|||
}, |
|||
'rule': { |
|||
pattern: /(^|[^<\w-])[a-z][\w-]*|<[^>\r\n]*>/i, |
|||
lookbehind: true, |
|||
inside: { |
|||
'punctuation': /<|>/ |
|||
} |
|||
}, |
|||
'operator': /=\/?|\//, |
|||
'punctuation': /[()\[\]]/ |
|||
}; |
|||
|
|||
})(Prism); |
|||
@ -0,0 +1 @@ |
|||
!function(n){var i="(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)";Prism.languages.abnf={comment:/;.*/,string:{pattern:/(?:%[is])?"[^"\n\r]*"/,greedy:!0,inside:{punctuation:/^%[is]/}},range:{pattern:/%(?:b[01]+-[01]+|d\d+-\d+|x[A-F\d]+-[A-F\d]+)/i,alias:"number"},terminal:{pattern:/%(?:b[01]+(?:\.[01]+)*|d\d+(?:\.\d+)*|x[A-F\d]+(?:\.[A-F\d]+)*)/i,alias:"number"},repetition:{pattern:/(^|[^\w-])(?:\d*\*\d*|\d+)/,lookbehind:!0,alias:"operator"},definition:{pattern:/(^[ \t]*)(?:[a-z][\w-]*|<[^>\r\n]*>)(?=\s*=)/m,lookbehind:!0,alias:"keyword",inside:{punctuation:/<|>/}},"core-rule":{pattern:RegExp("(?:(^|[^<\\w-])"+i+"|<"+i+">)(?![\\w-])","i"),lookbehind:!0,alias:["rule","constant"],inside:{punctuation:/<|>/}},rule:{pattern:/(^|[^<\w-])[a-z][\w-]*|<[^>\r\n]*>/i,lookbehind:!0,inside:{punctuation:/<|>/}},operator:/=\/?|\//,punctuation:/[()\[\]]/}}(); |
|||
@ -0,0 +1,15 @@ |
|||
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>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/, |
|||
lookbehind: true, |
|||
inside: Prism.languages.markup |
|||
} |
|||
}); |
|||
} |
|||
@ -0,0 +1 @@ |
|||
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",Prism.languages.markup&&Prism.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:Prism.languages.markup}}); |
|||
@ -0,0 +1,19 @@ |
|||
Prism.languages.ada = { |
|||
'comment': /--.*/, |
|||
'string': /"(?:""|[^"\r\f\n])*"/i, |
|||
'number': [ |
|||
{ |
|||
pattern: /\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i |
|||
}, |
|||
{ |
|||
pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i |
|||
} |
|||
], |
|||
'attr-name': /\b'\w+/i, |
|||
'keyword': /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|new|return|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i, |
|||
'boolean': /\b(?:true|false)\b/i, |
|||
'operator': /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/, |
|||
'punctuation': /\.\.?|[,;():]/, |
|||
'char': /'.'/, |
|||
'variable': /\b[a-z](?:[_a-z\d])*\b/i |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.ada={comment:/--.*/,string:/"(?:""|[^"\r\f\n])*"/i,number:[{pattern:/\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i},{pattern:/\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i}],"attr-name":/\b'\w+/i,keyword:/\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|new|return|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,boolean:/\b(?:true|false)\b/i,operator:/<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,punctuation:/\.\.?|[,;():]/,char:/'.'/,variable:/\b[a-z](?:[_a-z\d])*\b/i}; |
|||
@ -0,0 +1,65 @@ |
|||
Prism.languages.antlr4 = { |
|||
'comment': /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, |
|||
'string': { |
|||
pattern: /'(?:\\.|[^\\'\r\n])*'/, |
|||
greedy: true |
|||
}, |
|||
'character-class': { |
|||
pattern: /\[(?:\\.|[^\\\]\r\n])*\]/, |
|||
greedy: true, |
|||
alias: 'regex', |
|||
inside: { |
|||
'range': { |
|||
pattern: /([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/, |
|||
lookbehind: true, |
|||
alias: 'punctuation' |
|||
}, |
|||
'escape': /\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/, |
|||
'punctuation': /[\[\]]/ |
|||
} |
|||
}, |
|||
'action': { |
|||
pattern: /\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/, |
|||
greedy: true, |
|||
inside: { |
|||
'content': { |
|||
// this might be C, C++, Python, Java, C#, or any other language ANTLR4 compiles to
|
|||
pattern: /(\{)[\s\S]+(?=\})/, |
|||
lookbehind: true |
|||
}, |
|||
'punctuation': /[{}]/ |
|||
} |
|||
}, |
|||
'command': { |
|||
pattern: /(->\s*)(?:\s*(?:,\s*)?[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i, |
|||
lookbehind: true, |
|||
inside: { |
|||
'function': /\b\w+(?=\s*(?:[,(]|$))/, |
|||
'punctuation': /[,()]/ |
|||
} |
|||
}, |
|||
'annotation': { |
|||
pattern: /@\w+(?:::\w+)*/, |
|||
alias: 'keyword' |
|||
}, |
|||
'label': { |
|||
pattern: /#[ \t]*\w+/, |
|||
alias: 'punctuation' |
|||
}, |
|||
'keyword': /\b(?:catch|channels|finally|fragment|grammar|import|lexer|locals|mode|options|parser|returns|throws|tokens)\b/, |
|||
'definition': [ |
|||
{ |
|||
pattern: /\b[a-z]\w*(?=\s*:)/, |
|||
alias: ['rule', 'class-name'] |
|||
}, |
|||
{ |
|||
pattern: /\b[A-Z]\w*(?=\s*:)/, |
|||
alias: ['token', 'constant'] |
|||
}, |
|||
], |
|||
'constant': /\b[A-Z][A-Z_]*\b/, |
|||
'operator': /\.\.|->|[|~]|[*+?]\??/, |
|||
'punctuation': /[;:()=]/ |
|||
}; |
|||
|
|||
Prism.languages.g4 = Prism.languages.antlr4; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.antlr4={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,string:{pattern:/'(?:\\.|[^\\'\r\n])*'/,greedy:!0},"character-class":{pattern:/\[(?:\\.|[^\\\]\r\n])*\]/,greedy:!0,alias:"regex",inside:{range:{pattern:/([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/,lookbehind:!0,alias:"punctuation"},escape:/\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/,punctuation:/[\[\]]/}},action:{pattern:/\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/,greedy:!0,inside:{content:{pattern:/(\{)[\s\S]+(?=\})/,lookbehind:!0},punctuation:/[{}]/}},command:{pattern:/(->\s*)(?:\s*(?:,\s*)?[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i,lookbehind:!0,inside:{function:/\b\w+(?=\s*(?:[,(]|$))/,punctuation:/[,()]/}},annotation:{pattern:/@\w+(?:::\w+)*/,alias:"keyword"},label:{pattern:/#[ \t]*\w+/,alias:"punctuation"},keyword:/\b(?:catch|channels|finally|fragment|grammar|import|lexer|locals|mode|options|parser|returns|throws|tokens)\b/,definition:[{pattern:/\b[a-z]\w*(?=\s*:)/,alias:["rule","class-name"]},{pattern:/\b[A-Z]\w*(?=\s*:)/,alias:["token","constant"]}],constant:/\b[A-Z][A-Z_]*\b/,operator:/\.\.|->|[|~]|[*+?]\??/,punctuation:/[;:()=]/},Prism.languages.g4=Prism.languages.antlr4; |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,32 @@ |
|||
Prism.languages.apl = { |
|||
'comment': /(?:⍝|#[! ]).*$/m, |
|||
'string': { |
|||
pattern: /'(?:[^'\r\n]|'')*'/, |
|||
greedy: true |
|||
}, |
|||
'number': /¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞))?/i, |
|||
'statement': /:[A-Z][a-z][A-Za-z]*\b/, |
|||
'system-function': { |
|||
pattern: /⎕[A-Z]+/i, |
|||
alias: 'function' |
|||
}, |
|||
'constant': /[⍬⌾#⎕⍞]/, |
|||
'function': /[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/, |
|||
'monadic-operator': { |
|||
pattern: /[\\\/⌿⍀¨⍨⌶&∥]/, |
|||
alias: 'operator' |
|||
}, |
|||
'dyadic-operator': { |
|||
pattern: /[.⍣⍠⍤∘⌸@⌺]/, |
|||
alias: 'operator' |
|||
}, |
|||
'assignment': { |
|||
pattern: /←/, |
|||
alias: 'keyword' |
|||
}, |
|||
'punctuation': /[\[;\]()◇⋄]/, |
|||
'dfn': { |
|||
pattern: /[{}⍺⍵⍶⍹∇⍫:]/, |
|||
alias: 'builtin' |
|||
} |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.apl={comment:/(?:⍝|#[! ]).*$/m,string:{pattern:/'(?:[^'\r\n]|'')*'/,greedy:!0},number:/¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞))?/i,statement:/:[A-Z][a-z][A-Za-z]*\b/,"system-function":{pattern:/⎕[A-Z]+/i,alias:"function"},constant:/[⍬⌾#⎕⍞]/,function:/[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,"monadic-operator":{pattern:/[\\\/⌿⍀¨⍨⌶&∥]/,alias:"operator"},"dyadic-operator":{pattern:/[.⍣⍠⍤∘⌸@⌺]/,alias:"operator"},assignment:{pattern:/←/,alias:"keyword"},punctuation:/[\[;\]()◇⋄]/,dfn:{pattern:/[{}⍺⍵⍶⍹∇⍫:]/,alias:"builtin"}}; |
|||
@ -0,0 +1,20 @@ |
|||
Prism.languages.applescript = { |
|||
'comment': [ |
|||
// Allow one level of nesting
|
|||
/\(\*(?:\(\*[\s\S]*?\*\)|[\s\S])*?\*\)/, |
|||
/--.+/, |
|||
/#.+/ |
|||
], |
|||
'string': /"(?:\\.|[^"\\\r\n])*"/, |
|||
'number': /(?:\b\d+\.?\d*|\B\.\d+)(?:e-?\d+)?\b/i, |
|||
'operator': [ |
|||
/[&=≠≤≥*+\-\/÷^]|[<>]=?/, |
|||
/\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/ |
|||
], |
|||
'keyword': /\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/, |
|||
'class': { |
|||
pattern: /\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/, |
|||
alias: 'builtin' |
|||
}, |
|||
'punctuation': /[{}():,¬«»《》]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.applescript={comment:[/\(\*(?:\(\*[\s\S]*?\*\)|[\s\S])*?\*\)/,/--.+/,/#.+/],string:/"(?:\\.|[^"\\\r\n])*"/,number:/(?:\b\d+\.?\d*|\B\.\d+)(?:e-?\d+)?\b/i,operator:[/[&=≠≤≥*+\-\/÷^]|[<>]=?/,/\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/],keyword:/\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,class:{pattern:/\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/,alias:"builtin"},punctuation:/[{}():,¬«»《》]/}; |
|||
@ -0,0 +1,41 @@ |
|||
Prism.languages.aql = { |
|||
'comment': /\/\/.*|\/\*[\s\S]*?\*\//, |
|||
'property': { |
|||
pattern: /([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
'string': { |
|||
pattern: /(["'´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/, |
|||
greedy: true |
|||
}, |
|||
'variable': /@@?\w+/, |
|||
'keyword': [ |
|||
{ |
|||
pattern: /(\bWITH\s+)COUNT(?=\s+INTO\b)/i, |
|||
lookbehind: true |
|||
}, |
|||
/\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WITH)\b/i, |
|||
// pseudo keywords get a lookbehind to avoid false positives
|
|||
{ |
|||
pattern: /(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i, |
|||
lookbehind: true |
|||
}, |
|||
{ |
|||
pattern: /(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/, |
|||
lookbehind: true |
|||
}, |
|||
{ |
|||
pattern: /\bOPTIONS(?=\s*{)/i |
|||
} |
|||
], |
|||
'function': /(?!\d)\w+(?=\s*\()/, |
|||
'boolean': /(?:true|false)/i, |
|||
'range': { |
|||
pattern: /\.\./, |
|||
alias: 'operator' |
|||
}, |
|||
'number': /(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i, |
|||
'operator': /\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/, |
|||
'punctuation': /::|[?.:,;()[\]{}]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.aql={comment:/\/\/.*|\/\*[\s\S]*?\*\//,property:{pattern:/([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(["'´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/,greedy:!0},variable:/@@?\w+/,keyword:[{pattern:/(\bWITH\s+)COUNT(?=\s+INTO\b)/i,lookbehind:!0},/\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WITH)\b/i,{pattern:/(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i,lookbehind:!0},{pattern:/(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/,lookbehind:!0},{pattern:/\bOPTIONS(?=\s*{)/i}],function:/(?!\d)\w+(?=\s*\()/,boolean:/(?:true|false)/i,range:{pattern:/\.\./,alias:"operator"},number:/(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i,operator:/\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/,punctuation:/::|[?.:,;()[\]{}]/}; |
|||
@ -0,0 +1,5 @@ |
|||
Prism.languages.arduino = Prism.languages.extend('cpp', { |
|||
'keyword': /\b(?:setup|if|else|while|do|for|return|in|instanceof|default|function|loop|goto|switch|case|new|try|throw|catch|finally|null|break|continue|boolean|bool|void|byte|word|string|String|array|int|long|integer|double)\b/, |
|||
'builtin': /\b(?:KeyboardController|MouseController|SoftwareSerial|EthernetServer|EthernetClient|LiquidCrystal|LiquidCrystal_I2C|RobotControl|GSMVoiceCall|EthernetUDP|EsploraTFT|HttpClient|RobotMotor|WiFiClient|GSMScanner|FileSystem|Scheduler|GSMServer|YunClient|YunServer|IPAddress|GSMClient|GSMModem|Keyboard|Ethernet|Console|GSMBand|Esplora|Stepper|Process|WiFiUDP|GSM_SMS|Mailbox|USBHost|Firmata|PImage|Client|Server|GSMPIN|FileIO|Bridge|Serial|EEPROM|Stream|Mouse|Audio|Servo|File|Task|GPRS|WiFi|Wire|TFT|GSM|SPI|SD|runShellCommandAsynchronously|analogWriteResolution|retrieveCallingNumber|printFirmwareVersion|analogReadResolution|sendDigitalPortPair|noListenOnLocalhost|readJoystickButton|setFirmwareVersion|readJoystickSwitch|scrollDisplayRight|getVoiceCallStatus|scrollDisplayLeft|writeMicroseconds|delayMicroseconds|beginTransmission|getSignalStrength|runAsynchronously|getAsynchronously|listenOnLocalhost|getCurrentCarrier|readAccelerometer|messageAvailable|sendDigitalPorts|lineFollowConfig|countryNameWrite|runShellCommand|readStringUntil|rewindDirectory|readTemperature|setClockDivider|readLightSensor|endTransmission|analogReference|detachInterrupt|countryNameRead|attachInterrupt|encryptionType|readBytesUntil|robotNameWrite|readMicrophone|robotNameRead|cityNameWrite|userNameWrite|readJoystickY|readJoystickX|mouseReleased|openNextFile|scanNetworks|noInterrupts|digitalWrite|beginSpeaker|mousePressed|isActionDone|mouseDragged|displayLogos|noAutoscroll|addParameter|remoteNumber|getModifiers|keyboardRead|userNameRead|waitContinue|processInput|parseCommand|printVersion|readNetworks|writeMessage|blinkVersion|cityNameRead|readMessage|setDataMode|parsePacket|isListening|setBitOrder|beginPacket|isDirectory|motorsWrite|drawCompass|digitalRead|clearScreen|serialEvent|rightToLeft|setTextSize|leftToRight|requestFrom|keyReleased|compassRead|analogWrite|interrupts|WiFiServer|disconnect|playMelody|parseFloat|autoscroll|getPINUsed|setPINUsed|setTimeout|sendAnalog|readSlider|analogRead|beginWrite|createChar|motorsStop|keyPressed|tempoWrite|readButton|subnetMask|debugPrint|macAddress|writeGreen|randomSeed|attachGPRS|readString|sendString|remotePort|releaseAll|mouseMoved|background|getXChange|getYChange|answerCall|getResult|voiceCall|endPacket|constrain|getSocket|writeJSON|getButton|available|connected|findUntil|readBytes|exitValue|readGreen|writeBlue|startLoop|IPAddress|isPressed|sendSysex|pauseMode|gatewayIP|setCursor|getOemKey|tuneWrite|noDisplay|loadImage|switchPIN|onRequest|onReceive|changePIN|playFile|noBuffer|parseInt|overflow|checkPIN|knobRead|beginTFT|bitClear|updateIR|bitWrite|position|writeRGB|highByte|writeRed|setSpeed|readBlue|noStroke|remoteIP|transfer|shutdown|hangCall|beginSMS|endWrite|attached|maintain|noCursor|checkReg|checkPUK|shiftOut|isValid|shiftIn|pulseIn|connect|println|localIP|pinMode|getIMEI|display|noBlink|process|getBand|running|beginSD|drawBMP|lowByte|setBand|release|bitRead|prepare|pointTo|readRed|setMode|noFill|remove|listen|stroke|detach|attach|noTone|exists|buffer|height|bitSet|circle|config|cursor|random|IRread|setDNS|endSMS|getKey|micros|millis|begin|print|write|ready|flush|width|isPIN|blink|clear|press|mkdir|rmdir|close|point|yield|image|BSSID|click|delay|read|text|move|peek|beep|rect|line|open|seek|fill|size|turn|stop|home|find|step|tone|sqrt|RSSI|SSID|end|bit|tan|cos|sin|pow|map|abs|max|min|get|run|put)\b/, |
|||
'constant': /\b(?:DIGITAL_MESSAGE|FIRMATA_STRING|ANALOG_MESSAGE|REPORT_DIGITAL|REPORT_ANALOG|INPUT_PULLUP|SET_PIN_MODE|INTERNAL2V56|SYSTEM_RESET|LED_BUILTIN|INTERNAL1V1|SYSEX_START|INTERNAL|EXTERNAL|DEFAULT|OUTPUT|INPUT|HIGH|LOW)\b/ |
|||
}); |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.arduino=Prism.languages.extend("cpp",{keyword:/\b(?:setup|if|else|while|do|for|return|in|instanceof|default|function|loop|goto|switch|case|new|try|throw|catch|finally|null|break|continue|boolean|bool|void|byte|word|string|String|array|int|long|integer|double)\b/,builtin:/\b(?:KeyboardController|MouseController|SoftwareSerial|EthernetServer|EthernetClient|LiquidCrystal|LiquidCrystal_I2C|RobotControl|GSMVoiceCall|EthernetUDP|EsploraTFT|HttpClient|RobotMotor|WiFiClient|GSMScanner|FileSystem|Scheduler|GSMServer|YunClient|YunServer|IPAddress|GSMClient|GSMModem|Keyboard|Ethernet|Console|GSMBand|Esplora|Stepper|Process|WiFiUDP|GSM_SMS|Mailbox|USBHost|Firmata|PImage|Client|Server|GSMPIN|FileIO|Bridge|Serial|EEPROM|Stream|Mouse|Audio|Servo|File|Task|GPRS|WiFi|Wire|TFT|GSM|SPI|SD|runShellCommandAsynchronously|analogWriteResolution|retrieveCallingNumber|printFirmwareVersion|analogReadResolution|sendDigitalPortPair|noListenOnLocalhost|readJoystickButton|setFirmwareVersion|readJoystickSwitch|scrollDisplayRight|getVoiceCallStatus|scrollDisplayLeft|writeMicroseconds|delayMicroseconds|beginTransmission|getSignalStrength|runAsynchronously|getAsynchronously|listenOnLocalhost|getCurrentCarrier|readAccelerometer|messageAvailable|sendDigitalPorts|lineFollowConfig|countryNameWrite|runShellCommand|readStringUntil|rewindDirectory|readTemperature|setClockDivider|readLightSensor|endTransmission|analogReference|detachInterrupt|countryNameRead|attachInterrupt|encryptionType|readBytesUntil|robotNameWrite|readMicrophone|robotNameRead|cityNameWrite|userNameWrite|readJoystickY|readJoystickX|mouseReleased|openNextFile|scanNetworks|noInterrupts|digitalWrite|beginSpeaker|mousePressed|isActionDone|mouseDragged|displayLogos|noAutoscroll|addParameter|remoteNumber|getModifiers|keyboardRead|userNameRead|waitContinue|processInput|parseCommand|printVersion|readNetworks|writeMessage|blinkVersion|cityNameRead|readMessage|setDataMode|parsePacket|isListening|setBitOrder|beginPacket|isDirectory|motorsWrite|drawCompass|digitalRead|clearScreen|serialEvent|rightToLeft|setTextSize|leftToRight|requestFrom|keyReleased|compassRead|analogWrite|interrupts|WiFiServer|disconnect|playMelody|parseFloat|autoscroll|getPINUsed|setPINUsed|setTimeout|sendAnalog|readSlider|analogRead|beginWrite|createChar|motorsStop|keyPressed|tempoWrite|readButton|subnetMask|debugPrint|macAddress|writeGreen|randomSeed|attachGPRS|readString|sendString|remotePort|releaseAll|mouseMoved|background|getXChange|getYChange|answerCall|getResult|voiceCall|endPacket|constrain|getSocket|writeJSON|getButton|available|connected|findUntil|readBytes|exitValue|readGreen|writeBlue|startLoop|IPAddress|isPressed|sendSysex|pauseMode|gatewayIP|setCursor|getOemKey|tuneWrite|noDisplay|loadImage|switchPIN|onRequest|onReceive|changePIN|playFile|noBuffer|parseInt|overflow|checkPIN|knobRead|beginTFT|bitClear|updateIR|bitWrite|position|writeRGB|highByte|writeRed|setSpeed|readBlue|noStroke|remoteIP|transfer|shutdown|hangCall|beginSMS|endWrite|attached|maintain|noCursor|checkReg|checkPUK|shiftOut|isValid|shiftIn|pulseIn|connect|println|localIP|pinMode|getIMEI|display|noBlink|process|getBand|running|beginSD|drawBMP|lowByte|setBand|release|bitRead|prepare|pointTo|readRed|setMode|noFill|remove|listen|stroke|detach|attach|noTone|exists|buffer|height|bitSet|circle|config|cursor|random|IRread|setDNS|endSMS|getKey|micros|millis|begin|print|write|ready|flush|width|isPIN|blink|clear|press|mkdir|rmdir|close|point|yield|image|BSSID|click|delay|read|text|move|peek|beep|rect|line|open|seek|fill|size|turn|stop|home|find|step|tone|sqrt|RSSI|SSID|end|bit|tan|cos|sin|pow|map|abs|max|min|get|run|put)\b/,constant:/\b(?:DIGITAL_MESSAGE|FIRMATA_STRING|ANALOG_MESSAGE|REPORT_DIGITAL|REPORT_ANALOG|INPUT_PULLUP|SET_PIN_MODE|INTERNAL2V56|SYSTEM_RESET|LED_BUILTIN|INTERNAL1V1|SYSEX_START|INTERNAL|EXTERNAL|DEFAULT|OUTPUT|INPUT|HIGH|LOW)\b/}); |
|||
@ -0,0 +1,10 @@ |
|||
Prism.languages.arff = { |
|||
'comment': /%.*/, |
|||
'string': { |
|||
pattern: /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/, |
|||
greedy: true |
|||
}, |
|||
'keyword': /@(?:attribute|data|end|relation)\b/i, |
|||
'number': /\b\d+(?:\.\d+)?\b/, |
|||
'punctuation': /[{},]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.arff={comment:/%.*/,string:{pattern:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/@(?:attribute|data|end|relation)\b/i,number:/\b\d+(?:\.\d+)?\b/,punctuation:/[{},]/}; |
|||
@ -0,0 +1,234 @@ |
|||
(function (Prism) { |
|||
|
|||
var attributes = { |
|||
pattern: /(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\]\\]|\\.)*\]|[^\]\\]|\\.)*\]/m, |
|||
lookbehind: true, |
|||
inside: { |
|||
'quoted': { |
|||
pattern: /([$`])(?:(?!\1)[^\\]|\\.)*\1/, |
|||
inside: { |
|||
'punctuation': /^[$`]|[$`]$/ |
|||
} |
|||
}, |
|||
'interpreted': { |
|||
pattern: /'(?:[^'\\]|\\.)*'/, |
|||
inside: { |
|||
'punctuation': /^'|'$/ |
|||
// See rest below
|
|||
} |
|||
}, |
|||
'string': /"(?:[^"\\]|\\.)*"/, |
|||
'variable': /\w+(?==)/, |
|||
'punctuation': /^\[|\]$|,/, |
|||
'operator': /=/, |
|||
// The negative look-ahead prevents blank matches
|
|||
'attr-value': /(?!^\s+$).+/ |
|||
} |
|||
}; |
|||
|
|||
var asciidoc = Prism.languages.asciidoc = { |
|||
'comment-block': { |
|||
pattern: /^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m, |
|||
alias: 'comment' |
|||
}, |
|||
'table': { |
|||
pattern: /^\|={3,}(?:(?:\r?\n|\r).*)*?(?:\r?\n|\r)\|={3,}$/m, |
|||
inside: { |
|||
'specifiers': { |
|||
pattern: /(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/, |
|||
alias: 'attr-value' |
|||
}, |
|||
'punctuation': { |
|||
pattern: /(^|[^\\])[|!]=*/, |
|||
lookbehind: true |
|||
} |
|||
// See rest below
|
|||
} |
|||
}, |
|||
|
|||
'passthrough-block': { |
|||
pattern: /^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, |
|||
inside: { |
|||
'punctuation': /^\++|\++$/ |
|||
// See rest below
|
|||
} |
|||
}, |
|||
// Literal blocks and listing blocks
|
|||
'literal-block': { |
|||
pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, |
|||
inside: { |
|||
'punctuation': /^(?:-+|\.+)|(?:-+|\.+)$/ |
|||
// See rest below
|
|||
} |
|||
}, |
|||
// Sidebar blocks, quote blocks, example blocks and open blocks
|
|||
'other-block': { |
|||
pattern: /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, |
|||
inside: { |
|||
'punctuation': /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/ |
|||
// See rest below
|
|||
} |
|||
}, |
|||
|
|||
// list-punctuation and list-label must appear before indented-block
|
|||
'list-punctuation': { |
|||
pattern: /(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im, |
|||
lookbehind: true, |
|||
alias: 'punctuation' |
|||
}, |
|||
'list-label': { |
|||
pattern: /(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im, |
|||
lookbehind: true, |
|||
alias: 'symbol' |
|||
}, |
|||
'indented-block': { |
|||
pattern: /((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/, |
|||
lookbehind: true |
|||
}, |
|||
|
|||
'comment': /^\/\/.*/m, |
|||
'title': { |
|||
pattern: /^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} +.+|^\.(?![\s.]).*/m, |
|||
alias: 'important', |
|||
inside: { |
|||
'punctuation': /^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/ |
|||
// See rest below
|
|||
} |
|||
}, |
|||
'attribute-entry': { |
|||
pattern: /^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m, |
|||
alias: 'tag' |
|||
}, |
|||
'attributes': attributes, |
|||
'hr': { |
|||
pattern: /^'{3,}$/m, |
|||
alias: 'punctuation' |
|||
}, |
|||
'page-break': { |
|||
pattern: /^<{3,}$/m, |
|||
alias: 'punctuation' |
|||
}, |
|||
'admonition': { |
|||
pattern: /^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m, |
|||
alias: 'keyword' |
|||
}, |
|||
'callout': [ |
|||
{ |
|||
pattern: /(^[ \t]*)<?\d*>/m, |
|||
lookbehind: true, |
|||
alias: 'symbol' |
|||
}, |
|||
{ |
|||
pattern: /<\d+>/, |
|||
alias: 'symbol' |
|||
} |
|||
], |
|||
'macro': { |
|||
pattern: /\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, |
|||
inside: { |
|||
'function': /^[a-z\d-]+(?=:)/, |
|||
'punctuation': /^::?/, |
|||
'attributes': { |
|||
pattern: /(?:\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, |
|||
inside: attributes.inside |
|||
} |
|||
} |
|||
}, |
|||
'inline': { |
|||
/* |
|||
The initial look-behind prevents the highlighting of escaped quoted text. |
|||
|
|||
Quoted text can be multi-line but cannot span an empty line. |
|||
All quoted text can have attributes before [foobar, 'foobar', baz="bar"]. |
|||
|
|||
First, we handle the constrained quotes. |
|||
Those must be bounded by non-word chars and cannot have spaces between the delimiter and the first char. |
|||
They are, in order: _emphasis_, ``double quotes'', `single quotes', `monospace`, 'emphasis', *strong*, +monospace+ and #unquoted#
|
|||
|
|||
Then we handle the unconstrained quotes. |
|||
Those do not have the restrictions of the constrained quotes. |
|||
They are, in order: __emphasis__, **strong**, ++monospace++, +++passthrough+++, ##unquoted##, $$passthrough$$, ~subscript~, ^superscript^, {attribute-reference}, [[anchor]], [[[bibliography anchor]]], <<xref>>, (((indexes))) and ((indexes)) |
|||
*/ |
|||
pattern: /(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m, |
|||
lookbehind: true, |
|||
inside: { |
|||
'attributes': attributes, |
|||
'url': { |
|||
pattern: /^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/, |
|||
inside: { |
|||
'punctuation': /^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/ |
|||
} |
|||
}, |
|||
'attribute-ref': { |
|||
pattern: /^\{.+\}$/, |
|||
inside: { |
|||
'variable': { |
|||
pattern: /(^\{)[a-z\d,+_-]+/, |
|||
lookbehind: true |
|||
}, |
|||
'operator': /^[=?!#%@$]|!(?=[:}])/, |
|||
'punctuation': /^\{|\}$|::?/ |
|||
} |
|||
}, |
|||
'italic': { |
|||
pattern: /^(['_])[\s\S]+\1$/, |
|||
inside: { |
|||
'punctuation': /^(?:''?|__?)|(?:''?|__?)$/ |
|||
} |
|||
}, |
|||
'bold': { |
|||
pattern: /^\*[\s\S]+\*$/, |
|||
inside: { |
|||
punctuation: /^\*\*?|\*\*?$/ |
|||
} |
|||
}, |
|||
'punctuation': /^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/ |
|||
} |
|||
}, |
|||
'replacement': { |
|||
pattern: /\((?:C|TM|R)\)/, |
|||
alias: 'builtin' |
|||
}, |
|||
'entity': /&#?[\da-z]{1,8};/i, |
|||
'line-continuation': { |
|||
pattern: /(^| )\+$/m, |
|||
lookbehind: true, |
|||
alias: 'punctuation' |
|||
} |
|||
}; |
|||
|
|||
|
|||
// Allow some nesting. There is no recursion though, so cloning should not be needed.
|
|||
|
|||
function copyFromAsciiDoc(keys) { |
|||
keys = keys.split(' '); |
|||
|
|||
var o = {}; |
|||
for (var i = 0, l = keys.length; i < l; i++) { |
|||
o[keys[i]] = asciidoc[keys[i]]; |
|||
} |
|||
return o; |
|||
} |
|||
|
|||
attributes.inside['interpreted'].inside.rest = copyFromAsciiDoc('macro inline replacement entity'); |
|||
|
|||
asciidoc['passthrough-block'].inside.rest = copyFromAsciiDoc('macro'); |
|||
|
|||
asciidoc['literal-block'].inside.rest = copyFromAsciiDoc('callout'); |
|||
|
|||
asciidoc['table'].inside.rest = copyFromAsciiDoc('comment-block passthrough-block literal-block other-block list-punctuation indented-block comment title attribute-entry attributes hr page-break admonition list-label callout macro inline replacement entity line-continuation'); |
|||
|
|||
asciidoc['other-block'].inside.rest = copyFromAsciiDoc('table list-punctuation indented-block comment attribute-entry attributes hr page-break admonition list-label macro inline replacement entity line-continuation'); |
|||
|
|||
asciidoc['title'].inside.rest = copyFromAsciiDoc('macro inline replacement entity'); |
|||
|
|||
|
|||
// 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.adoc = Prism.languages.asciidoc; |
|||
}(Prism)); |
|||
@ -0,0 +1 @@ |
|||
!function(t){var n={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\]\\]|\\.)*\]|[^\]\\]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},string:/"(?:[^"\\]|\\.)*"/,variable:/\w+(?==)/,punctuation:/^\[|\]$|,/,operator:/=/,"attr-value":/(?!^\s+$).+/}},a=t.languages.asciidoc={"comment-block":{pattern:/^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m,alias:"comment"},table:{pattern:/^\|={3,}(?:(?:\r?\n|\r).*)*?(?:\r?\n|\r)\|={3,}$/m,inside:{specifiers:{pattern:/(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} +.+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:n,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)<?\d*>/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{function:/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:n.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:n,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|TM|R)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}};function i(t){for(var n={},i=0,e=(t=t.split(" ")).length;i<e;i++)n[t[i]]=a[t[i]];return n}n.inside.interpreted.inside.rest=i("macro inline replacement entity"),a["passthrough-block"].inside.rest=i("macro"),a["literal-block"].inside.rest=i("callout"),a.table.inside.rest=i("comment-block passthrough-block literal-block other-block list-punctuation indented-block comment title attribute-entry attributes hr page-break admonition list-label callout macro inline replacement entity line-continuation"),a["other-block"].inside.rest=i("table list-punctuation indented-block comment attribute-entry attributes hr page-break admonition list-label macro inline replacement entity line-continuation"),a.title.inside.rest=i("macro inline replacement entity"),t.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))}),t.languages.adoc=t.languages.asciidoc}(Prism); |
|||
@ -0,0 +1,28 @@ |
|||
Prism.languages.asm6502 = { |
|||
'comment': /;.*/, |
|||
'directive': { |
|||
pattern: /\.\w+(?= )/, |
|||
alias: 'keyword' |
|||
}, |
|||
'string': /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/, |
|||
'opcode': { |
|||
pattern: /\b(?:adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya|ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA)\b/, |
|||
alias: 'property' |
|||
}, |
|||
'hexnumber': { |
|||
pattern: /#?\$[\da-f]{2,4}/i, |
|||
alias: 'string' |
|||
}, |
|||
'binarynumber': { |
|||
pattern: /#?%[01]+/, |
|||
alias: 'string' |
|||
}, |
|||
'decimalnumber': { |
|||
pattern: /#?\d+/, |
|||
alias: 'string' |
|||
}, |
|||
'register': { |
|||
pattern: /\b[xya]\b/i, |
|||
alias: 'variable' |
|||
} |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.asm6502={comment:/;.*/,directive:{pattern:/\.\w+(?= )/,alias:"keyword"},string:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,opcode:{pattern:/\b(?:adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya|ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA)\b/,alias:"property"},hexnumber:{pattern:/#?\$[\da-f]{2,4}/i,alias:"string"},binarynumber:{pattern:/#?%[01]+/,alias:"string"},decimalnumber:{pattern:/#?\d+/,alias:"string"},register:{pattern:/\b[xya]\b/i,alias:"variable"}}; |
|||
@ -0,0 +1,48 @@ |
|||
Prism.languages.aspnet = Prism.languages.extend('markup', { |
|||
'page-directive': { |
|||
pattern: /<%\s*@.*%>/i, |
|||
alias: 'tag', |
|||
inside: { |
|||
'page-directive': { |
|||
pattern: /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i, |
|||
alias: 'tag' |
|||
}, |
|||
rest: Prism.languages.markup.tag.inside |
|||
} |
|||
}, |
|||
'directive': { |
|||
pattern: /<%.*%>/i, |
|||
alias: 'tag', |
|||
inside: { |
|||
'directive': { |
|||
pattern: /<%\s*?[$=%#:]{0,2}|%>/i, |
|||
alias: 'tag' |
|||
}, |
|||
rest: Prism.languages.csharp |
|||
} |
|||
} |
|||
}); |
|||
// Regexp copied from prism-markup, with a negative look-ahead added
|
|||
Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i; |
|||
|
|||
// match directives of attribute value foo="<% Bar %>"
|
|||
Prism.languages.insertBefore('inside', 'punctuation', { |
|||
'directive': Prism.languages.aspnet['directive'] |
|||
}, Prism.languages.aspnet.tag.inside["attr-value"]); |
|||
|
|||
Prism.languages.insertBefore('aspnet', 'comment', { |
|||
'asp-comment': { |
|||
pattern: /<%--[\s\S]*?--%>/, |
|||
alias: ['asp', 'comment'] |
|||
} |
|||
}); |
|||
|
|||
// script runat="server" contains csharp, not javascript
|
|||
Prism.languages.insertBefore('aspnet', Prism.languages.javascript ? 'script' : 'tag', { |
|||
'asp-script': { |
|||
pattern: /(<script(?=.*runat=['"]?server['"]?)[\s\S]*?>)[\s\S]*?(?=<\/script>)/i, |
|||
lookbehind: true, |
|||
alias: ['asp', 'script'], |
|||
inside: Prism.languages.csharp || {} |
|||
} |
|||
}); |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.aspnet=Prism.languages.extend("markup",{"page-directive":{pattern:/<%\s*@.*%>/i,alias:"tag",inside:{"page-directive":{pattern:/<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,alias:"tag"},rest:Prism.languages.markup.tag.inside}},directive:{pattern:/<%.*%>/i,alias:"tag",inside:{directive:{pattern:/<%\s*?[$=%#:]{0,2}|%>/i,alias:"tag"},rest:Prism.languages.csharp}}}),Prism.languages.aspnet.tag.pattern=/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,Prism.languages.insertBefore("inside","punctuation",{directive:Prism.languages.aspnet.directive},Prism.languages.aspnet.tag.inside["attr-value"]),Prism.languages.insertBefore("aspnet","comment",{"asp-comment":{pattern:/<%--[\s\S]*?--%>/,alias:["asp","comment"]}}),Prism.languages.insertBefore("aspnet",Prism.languages.javascript?"script":"tag",{"asp-script":{pattern:/(<script(?=.*runat=['"]?server['"]?)[\s\S]*?>)[\s\S]*?(?=<\/script>)/i,lookbehind:!0,alias:["asp","script"],inside:Prism.languages.csharp||{}}}); |
|||
@ -0,0 +1,27 @@ |
|||
// NOTES - follows first-first highlight method, block is locked after highlight, different from SyntaxHl
|
|||
Prism.languages.autohotkey= { |
|||
'comment': { |
|||
pattern: /(^[^";\n]*(?:"[^"\n]*?"[^"\n]*?)*)(?:;.*$|^\s*\/\*[\s\S]*\n\*\/)/m, |
|||
lookbehind: true |
|||
}, |
|||
'string': /"(?:[^"\n\r]|"")*"/m, |
|||
'function': /[^(); \t,\n+*\-=?>:\\\/<&%\[\]]+?(?=\()/m, //function - don't use .*\) in the end bcoz string locks it
|
|||
'tag': /^[ \t]*[^\s:]+?(?=:(?:[^:]|$))/m, //labels
|
|||
'variable': /%\w+%/, |
|||
'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/, |
|||
'operator': /\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/, |
|||
'punctuation': /[{}[\]():,]/, |
|||
'boolean': /\b(?:true|false)\b/, |
|||
|
|||
'selector': /\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i, |
|||
|
|||
'constant': /\b(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\b/i, |
|||
|
|||
'builtin': /\b(?:abs|acos|asc|asin|atan|ceil|chr|class|cos|dllcall|exp|fileexist|Fileopen|floor|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__Set)\b/i, |
|||
|
|||
'symbol': /\b(?:alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i, |
|||
|
|||
'important': /#\b(?:AllowSameLineComments|ClipboardTimeout|CommentFlag|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InstallKeybdHook|InstallMouseHook|KeyHistory|LTrim|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|WinActivateForce)\b/i, |
|||
|
|||
'keyword': /\b(?:Abort|AboveNormal|Add|ahk_class|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Type|UnCheck|underline|Unicode|Unlock|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i |
|||
}; |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,34 @@ |
|||
Prism.languages.autoit = { |
|||
"comment": [ |
|||
/;.*/, |
|||
{ |
|||
// The multi-line comments delimiters can actually be commented out with ";"
|
|||
pattern: /(^\s*)#(?:comments-start|cs)[\s\S]*?^\s*#(?:comments-end|ce)/m, |
|||
lookbehind: true |
|||
} |
|||
], |
|||
"url": { |
|||
pattern: /(^\s*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m, |
|||
lookbehind: true |
|||
}, |
|||
"string": { |
|||
pattern: /(["'])(?:\1\1|(?!\1)[^\r\n])*\1/, |
|||
greedy: true, |
|||
inside: { |
|||
"variable": /([%$@])\w+\1/ |
|||
} |
|||
}, |
|||
"directive": { |
|||
pattern: /(^\s*)#\w+/m, |
|||
lookbehind: true, |
|||
alias: 'keyword' |
|||
}, |
|||
"function": /\b\w+(?=\()/, |
|||
// Variables and macros
|
|||
"variable": /[$@]\w+/, |
|||
"keyword": /\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i, |
|||
"number": /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i, |
|||
"boolean": /\b(?:True|False)\b/i, |
|||
"operator": /<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Or|Not)\b/i, |
|||
"punctuation": /[\[\]().,:]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.autoit={comment:[/;.*/,{pattern:/(^\s*)#(?:comments-start|cs)[\s\S]*?^\s*#(?:comments-end|ce)/m,lookbehind:!0}],url:{pattern:/(^\s*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,lookbehind:!0},string:{pattern:/(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,greedy:!0,inside:{variable:/([%$@])\w+\1/}},directive:{pattern:/(^\s*)#\w+/m,lookbehind:!0,alias:"keyword"},function:/\b\w+(?=\()/,variable:/[$@]\w+/,keyword:/\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,boolean:/\b(?:True|False)\b/i,operator:/<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Or|Not)\b/i,punctuation:/[\[\]().,:]/}; |
|||
@ -0,0 +1,198 @@ |
|||
(function(Prism) { |
|||
// $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
|
|||
// + LC_ALL, RANDOM, REPLY, SECONDS.
|
|||
// + make sure PS1..4 are here as they are not always set,
|
|||
// - some useless things.
|
|||
var envVars = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b'; |
|||
var insideString = { |
|||
'environment': { |
|||
pattern: RegExp("\\$" + envVars), |
|||
alias: 'constant' |
|||
}, |
|||
'variable': [ |
|||
// [0]: Arithmetic Environment
|
|||
{ |
|||
pattern: /\$?\(\([\s\S]+?\)\)/, |
|||
greedy: true, |
|||
inside: { |
|||
// If there is a $ sign at the beginning highlight $(( and )) as variable
|
|||
'variable': [ |
|||
{ |
|||
pattern: /(^\$\(\([\s\S]+)\)\)/, |
|||
lookbehind: true |
|||
}, |
|||
/^\$\(\(/ |
|||
], |
|||
'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/, |
|||
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
|
|||
'operator': /--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/, |
|||
// If there is no $ sign at the beginning highlight (( and )) as punctuation
|
|||
'punctuation': /\(\(?|\)\)?|,|;/ |
|||
} |
|||
}, |
|||
// [1]: Command Substitution
|
|||
{ |
|||
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/, |
|||
greedy: true, |
|||
inside: { |
|||
'variable': /^\$\(|^`|\)$|`$/ |
|||
} |
|||
}, |
|||
// [2]: Brace expansion
|
|||
{ |
|||
pattern: /\$\{[^}]+\}/, |
|||
greedy: true, |
|||
inside: { |
|||
'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/, |
|||
'punctuation': /[\[\]]/, |
|||
'environment': { |
|||
pattern: RegExp("(\\{)" + envVars), |
|||
lookbehind: true, |
|||
alias: 'constant' |
|||
} |
|||
} |
|||
}, |
|||
/\$(?:\w+|[#?*!@$])/ |
|||
], |
|||
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|||
'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/ |
|||
}; |
|||
|
|||
Prism.languages.bash = { |
|||
'shebang': { |
|||
pattern: /^#!\s*\/.*/, |
|||
alias: 'important' |
|||
}, |
|||
'comment': { |
|||
pattern: /(^|[^"{\\$])#.*/, |
|||
lookbehind: true |
|||
}, |
|||
'function-name': [ |
|||
// a) function foo {
|
|||
// b) foo() {
|
|||
// c) function foo() {
|
|||
// but not “foo {”
|
|||
{ |
|||
// a) and c)
|
|||
pattern: /(\bfunction\s+)\w+(?=(?:\s*\(?:\s*\))?\s*\{)/, |
|||
lookbehind: true, |
|||
alias: 'function' |
|||
}, |
|||
{ |
|||
// b)
|
|||
pattern: /\b\w+(?=\s*\(\s*\)\s*\{)/, |
|||
alias: 'function' |
|||
} |
|||
], |
|||
// Highlight variable names as variables in for and select beginnings.
|
|||
'for-or-select': { |
|||
pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/, |
|||
alias: 'variable', |
|||
lookbehind: true |
|||
}, |
|||
// Highlight variable names as variables in the left-hand part
|
|||
// of assignments (“=” and “+=”).
|
|||
'assign-left': { |
|||
pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/, |
|||
inside: { |
|||
'environment': { |
|||
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + envVars), |
|||
lookbehind: true, |
|||
alias: 'constant' |
|||
} |
|||
}, |
|||
alias: 'variable', |
|||
lookbehind: true |
|||
}, |
|||
'string': [ |
|||
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
|
|||
{ |
|||
pattern: /((?:^|[^<])<<-?\s*)(\w+?)\s*(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\2/, |
|||
lookbehind: true, |
|||
greedy: true, |
|||
inside: insideString |
|||
}, |
|||
// Here-document with quotes around the tag
|
|||
// → No expansion (so no “inside”).
|
|||
{ |
|||
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s*(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\3/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
// “Normal” string
|
|||
{ |
|||
pattern: /(^|[^\\](?:\\\\)*)(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\2)[^\\])*\2/, |
|||
lookbehind: true, |
|||
greedy: true, |
|||
inside: insideString |
|||
} |
|||
], |
|||
'environment': { |
|||
pattern: RegExp("\\$?" + envVars), |
|||
alias: 'constant' |
|||
}, |
|||
'variable': insideString.variable, |
|||
'function': { |
|||
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, |
|||
lookbehind: true |
|||
}, |
|||
'keyword': { |
|||
pattern: /(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/, |
|||
lookbehind: true |
|||
}, |
|||
// https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
|
|||
'builtin': { |
|||
pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/, |
|||
lookbehind: true, |
|||
// Alias added to make those easier to distinguish from strings.
|
|||
alias: 'class-name' |
|||
}, |
|||
'boolean': { |
|||
pattern: /(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/, |
|||
lookbehind: true |
|||
}, |
|||
'file-descriptor': { |
|||
pattern: /\B&\d\b/, |
|||
alias: 'important' |
|||
}, |
|||
'operator': { |
|||
// Lots of redirections here, but not just that.
|
|||
pattern: /\d?<>|>\||\+=|==?|!=?|=~|<<[<-]?|[&\d]?>>|\d?[<>]&?|&[>&]?|\|[&|]?|<=?|>=?/, |
|||
inside: { |
|||
'file-descriptor': { |
|||
pattern: /^\d/, |
|||
alias: 'important' |
|||
} |
|||
} |
|||
}, |
|||
'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/, |
|||
'number': { |
|||
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/, |
|||
lookbehind: true |
|||
} |
|||
}; |
|||
|
|||
/* Patterns in command substitution. */ |
|||
var toBeCopied = [ |
|||
'comment', |
|||
'function-name', |
|||
'for-or-select', |
|||
'assign-left', |
|||
'string', |
|||
'environment', |
|||
'function', |
|||
'keyword', |
|||
'builtin', |
|||
'boolean', |
|||
'file-descriptor', |
|||
'operator', |
|||
'punctuation', |
|||
'number' |
|||
]; |
|||
var inside = insideString.variable[1].inside; |
|||
for(var i = 0; i < toBeCopied.length; i++) { |
|||
inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]]; |
|||
} |
|||
|
|||
Prism.languages.shell = Prism.languages.bash; |
|||
})(Prism); |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,17 @@ |
|||
Prism.languages.basic = { |
|||
'comment': { |
|||
pattern: /(?:!|REM\b).+/i, |
|||
inside: { |
|||
'keyword': /^REM/i |
|||
} |
|||
}, |
|||
'string': { |
|||
pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^_ +\-.A-Z\d])*"/i, |
|||
greedy: true |
|||
}, |
|||
'number': /(?:\b\d+\.?\d*|\B\.\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': /[,;:()]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^_ +\-.A-Z\d])*"/i,greedy:!0},number:/(?:\b\d+\.?\d*|\B\.\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:/[,;:()]/}; |
|||
@ -0,0 +1,99 @@ |
|||
(function (Prism) { |
|||
var variable = /%%?[~:\w]+%?|!\S+!/; |
|||
var parameter = { |
|||
pattern: /\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im, |
|||
alias: 'attr-name', |
|||
inside: { |
|||
'punctuation': /:/ |
|||
} |
|||
}; |
|||
var string = /"[^"]*"/; |
|||
var number = /(?:\b|-)\d+\b/; |
|||
|
|||
Prism.languages.batch = { |
|||
'comment': [ |
|||
/^::.*/m, |
|||
{ |
|||
pattern: /((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, |
|||
lookbehind: true |
|||
} |
|||
], |
|||
'label': { |
|||
pattern: /^:.*/m, |
|||
alias: 'property' |
|||
}, |
|||
'command': [ |
|||
{ |
|||
// FOR command
|
|||
pattern: /((?:^|[&(])[ \t]*)for(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* \S+ in \([^)]+\) do/im, |
|||
lookbehind: true, |
|||
inside: { |
|||
'keyword': /^for\b|\b(?:in|do)\b/i, |
|||
'string': string, |
|||
'parameter': parameter, |
|||
'variable': variable, |
|||
'number': number, |
|||
'punctuation': /[()',]/ |
|||
} |
|||
}, |
|||
{ |
|||
// IF command
|
|||
pattern: /((?:^|[&(])[ \t]*)if(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|\S+)?(?:==| (?:equ|neq|lss|leq|gtr|geq) )(?:"[^"]*"|\S+))/im, |
|||
lookbehind: true, |
|||
inside: { |
|||
'keyword': /^if\b|\b(?:not|cmdextversion|defined|errorlevel|exist)\b/i, |
|||
'string': string, |
|||
'parameter': parameter, |
|||
'variable': variable, |
|||
'number': number, |
|||
'operator': /\^|==|\b(?:equ|neq|lss|leq|gtr|geq)\b/i |
|||
} |
|||
}, |
|||
{ |
|||
// ELSE command
|
|||
pattern: /((?:^|[&()])[ \t]*)else\b/im, |
|||
lookbehind: true, |
|||
inside: { |
|||
'keyword': /^else\b/i |
|||
} |
|||
}, |
|||
{ |
|||
// SET command
|
|||
pattern: /((?:^|[&(])[ \t]*)set(?: ?\/[a-z](?:[ :](?:"[^"]*"|\S+))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, |
|||
lookbehind: true, |
|||
inside: { |
|||
'keyword': /^set\b/i, |
|||
'string': string, |
|||
'parameter': parameter, |
|||
'variable': [ |
|||
variable, |
|||
/\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/ |
|||
], |
|||
'number': number, |
|||
'operator': /[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/, |
|||
'punctuation': /[()',]/ |
|||
} |
|||
}, |
|||
{ |
|||
// Other commands
|
|||
pattern: /((?:^|[&(])[ \t]*@?)\w+\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, |
|||
lookbehind: true, |
|||
inside: { |
|||
'keyword': /^\w+\b/i, |
|||
'string': string, |
|||
'parameter': parameter, |
|||
'label': { |
|||
pattern: /(^\s*):\S+/m, |
|||
lookbehind: true, |
|||
alias: 'property' |
|||
}, |
|||
'variable': variable, |
|||
'number': number, |
|||
'operator': /\^/ |
|||
} |
|||
} |
|||
], |
|||
'operator': /[&@]/, |
|||
'punctuation': /[()']/ |
|||
}; |
|||
}(Prism)); |
|||
@ -0,0 +1 @@ |
|||
!function(e){var r=/%%?[~:\w]+%?|!\S+!/,t={pattern:/\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,alias:"attr-name",inside:{punctuation:/:/}},n=/"[^"]*"/,i=/(?:\b|-)\d+\b/;Prism.languages.batch={comment:[/^::.*/m,{pattern:/((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0}],label:{pattern:/^:.*/m,alias:"property"},command:[{pattern:/((?:^|[&(])[ \t]*)for(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* \S+ in \([^)]+\) do/im,lookbehind:!0,inside:{keyword:/^for\b|\b(?:in|do)\b/i,string:n,parameter:t,variable:r,number:i,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*)if(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|\S+)?(?:==| (?:equ|neq|lss|leq|gtr|geq) )(?:"[^"]*"|\S+))/im,lookbehind:!0,inside:{keyword:/^if\b|\b(?:not|cmdextversion|defined|errorlevel|exist)\b/i,string:n,parameter:t,variable:r,number:i,operator:/\^|==|\b(?:equ|neq|lss|leq|gtr|geq)\b/i}},{pattern:/((?:^|[&()])[ \t]*)else\b/im,lookbehind:!0,inside:{keyword:/^else\b/i}},{pattern:/((?:^|[&(])[ \t]*)set(?: ?\/[a-z](?:[ :](?:"[^"]*"|\S+))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^set\b/i,string:n,parameter:t,variable:[r,/\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/],number:i,operator:/[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*@?)\w+\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^\w+\b/i,string:n,parameter:t,label:{pattern:/(^\s*):\S+/m,lookbehind:!0,alias:"property"},variable:r,number:i,operator:/\^/}}],operator:/[&@]/,punctuation:/[()']/}}(); |
|||
@ -0,0 +1,29 @@ |
|||
Prism.languages.bbcode = { |
|||
'tag': { |
|||
pattern: /\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/, |
|||
inside: { |
|||
'tag': { |
|||
pattern: /^\[\/?[^\s=\]]+/, |
|||
inside: { |
|||
'punctuation': /^\[\/?/ |
|||
} |
|||
}, |
|||
'attr-value': { |
|||
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/i, |
|||
inside: { |
|||
'punctuation': [ |
|||
/^=/, |
|||
{ |
|||
pattern: /^(\s*)["']|["']$/, |
|||
lookbehind: true |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
'punctuation': /\]/, |
|||
'attr-name': /[^\s=\]]+/ |
|||
} |
|||
} |
|||
}; |
|||
|
|||
Prism.languages.shortcode = Prism.languages.bbcode; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bbcode={tag:{pattern:/\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/,inside:{tag:{pattern:/^\[\/?[^\s=\]]+/,inside:{punctuation:/^\[\/?/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\]/,"attr-name":/[^\s=\]]+/}}},Prism.languages.shortcode=Prism.languages.bbcode; |
|||
@ -0,0 +1,39 @@ |
|||
Prism.languages.bison = Prism.languages.extend('c', {}); |
|||
|
|||
Prism.languages.insertBefore('bison', 'comment', { |
|||
'bison': { |
|||
// This should match all the beginning of the file
|
|||
// including the prologue(s), the bison declarations and
|
|||
// the grammar rules.
|
|||
pattern: /^[\s\S]*?%%[\s\S]*?%%/, |
|||
inside: { |
|||
'c': { |
|||
// Allow for one level of nested braces
|
|||
pattern: /%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/, |
|||
inside: { |
|||
'delimiter': { |
|||
pattern: /^%?\{|%?\}$/, |
|||
alias: 'punctuation' |
|||
}, |
|||
'bison-variable': { |
|||
pattern: /[$@](?:<[^\s>]+>)?[\w$]+/, |
|||
alias: 'variable', |
|||
inside: { |
|||
'punctuation': /<|>/ |
|||
} |
|||
}, |
|||
rest: Prism.languages.c |
|||
} |
|||
}, |
|||
'comment': Prism.languages.c.comment, |
|||
'string': Prism.languages.c.string, |
|||
'property': /\S+(?=:)/, |
|||
'keyword': /%\w+/, |
|||
'number': { |
|||
pattern: /(^|[^@])\b(?:0x[\da-f]+|\d+)/i, |
|||
lookbehind: true |
|||
}, |
|||
'punctuation': /%[%?]|[|:;\[\]<>]/ |
|||
} |
|||
} |
|||
}); |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bison=Prism.languages.extend("c",{}),Prism.languages.insertBefore("bison","comment",{bison:{pattern:/^[\s\S]*?%%[\s\S]*?%%/,inside:{c:{pattern:/%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/,inside:{delimiter:{pattern:/^%?\{|%?\}$/,alias:"punctuation"},"bison-variable":{pattern:/[$@](?:<[^\s>]+>)?[\w$]+/,alias:"variable",inside:{punctuation:/<|>/}},rest:Prism.languages.c}},comment:Prism.languages.c.comment,string:Prism.languages.c.string,property:/\S+(?=:)/,keyword:/%\w+/,number:{pattern:/(^|[^@])\b(?:0x[\da-f]+|\d+)/i,lookbehind:!0},punctuation:/%[%?]|[|:;\[\]<>]/}}}); |
|||
@ -0,0 +1,21 @@ |
|||
Prism.languages.bnf = { |
|||
'string': { |
|||
pattern: /"[^\r\n"]*"|'[^\r\n']*'/ |
|||
}, |
|||
'definition': { |
|||
pattern: /<[^<>\r\n\t]+>(?=\s*::=)/, |
|||
alias: ['rule', 'keyword'], |
|||
inside: { |
|||
'punctuation': /^<|>$/ |
|||
} |
|||
}, |
|||
'rule': { |
|||
pattern: /<[^<>\r\n\t]+>/, |
|||
inside: { |
|||
'punctuation': /^<|>$/ |
|||
} |
|||
}, |
|||
'operator': /::=|[|()[\]{}*+?]|\.{3}/ |
|||
}; |
|||
|
|||
Prism.languages.rbnf = Prism.languages.bnf; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bnf={string:{pattern:/"[^\r\n"]*"|'[^\r\n']*'/},definition:{pattern:/<[^<>\r\n\t]+>(?=\s*::=)/,alias:["rule","keyword"],inside:{punctuation:/^<|>$/}},rule:{pattern:/<[^<>\r\n\t]+>/,inside:{punctuation:/^<|>$/}},operator:/::=|[|()[\]{}*+?]|\.{3}/},Prism.languages.rbnf=Prism.languages.bnf; |
|||
@ -0,0 +1,20 @@ |
|||
Prism.languages.brainfuck = { |
|||
'pointer': { |
|||
pattern: /<|>/, |
|||
alias: 'keyword' |
|||
}, |
|||
'increment': { |
|||
pattern: /\+/, |
|||
alias: 'inserted' |
|||
}, |
|||
'decrement': { |
|||
pattern: /-/, |
|||
alias: 'deleted' |
|||
}, |
|||
'branching': { |
|||
pattern: /\[|\]/, |
|||
alias: 'important' |
|||
}, |
|||
'operator': /[.,]/, |
|||
'comment': /\S+/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.brainfuck={pointer:{pattern:/<|>/,alias:"keyword"},increment:{pattern:/\+/,alias:"inserted"},decrement:{pattern:/-/,alias:"deleted"},branching:{pattern:/\[|\]/,alias:"important"},operator:/[.,]/,comment:/\S+/}; |
|||
@ -0,0 +1,44 @@ |
|||
Prism.languages.brightscript = { |
|||
'comment': /(?:\brem|').*/i, |
|||
'directive-statement': { |
|||
pattern: /(^[\t ]*)#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if).*/im, |
|||
lookbehind: true, |
|||
alias: 'property', |
|||
inside: { |
|||
'error-message': { |
|||
pattern: /(^#error).+/, |
|||
lookbehind: true |
|||
}, |
|||
'directive': { |
|||
pattern: /^#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if)/, |
|||
alias: 'keyword' |
|||
}, |
|||
'expression': { |
|||
pattern: /[\s\S]+/, |
|||
inside: null // see below
|
|||
} |
|||
} |
|||
}, |
|||
'property': { |
|||
pattern: /([\r\n{,][\t ]*)(?:(?!\d)\w+|"(?:[^"\r\n]|"")*"(?!"))(?=[ \t]*:)/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
'string': { |
|||
pattern: /"(?:[^"\r\n]|"")*"(?!")/, |
|||
greedy: true |
|||
}, |
|||
'class-name': { |
|||
pattern: /(\bAs[\t ]+)\w+/i, |
|||
lookbehind: true |
|||
}, |
|||
'keyword': /\b(?:As|Dim|Each|Else|Elseif|End|Exit|For|Function|Goto|If|In|Print|Return|Step|Stop|Sub|Then|To|While)\b/i, |
|||
'boolean': /\b(?:true|false)\b/i, |
|||
'function': /\b(?!\d)\w+(?=[\t ]*\()/i, |
|||
'number': /(?:\b\d+(?:\.\d+)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b[%&!#]?/i, |
|||
'operator': /--|\+\+|>>=?|<<=?|<>|[-+*/\\<>]=?|[:^=?]|\b(?:and|mod|not|or)\b/i, |
|||
'punctuation': /[.,;()[\]{}]/, |
|||
'constant': /\b(?:LINE_NUM)\b/i |
|||
}; |
|||
|
|||
Prism.languages.brightscript['directive-statement'].inside.expression.inside = Prism.languages.brightscript; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.brightscript={comment:/(?:\brem|').*/i,"directive-statement":{pattern:/(^[\t ]*)#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if).*/im,lookbehind:!0,alias:"property",inside:{"error-message":{pattern:/(^#error).+/,lookbehind:!0},directive:{pattern:/^#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if)/,alias:"keyword"},expression:{pattern:/[\s\S]+/,inside:null}}},property:{pattern:/([\r\n{,][\t ]*)(?:(?!\d)\w+|"(?:[^"\r\n]|"")*"(?!"))(?=[ \t]*:)/,lookbehind:!0,greedy:!0},string:{pattern:/"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},"class-name":{pattern:/(\bAs[\t ]+)\w+/i,lookbehind:!0},keyword:/\b(?:As|Dim|Each|Else|Elseif|End|Exit|For|Function|Goto|If|In|Print|Return|Step|Stop|Sub|Then|To|While)\b/i,boolean:/\b(?:true|false)\b/i,function:/\b(?!\d)\w+(?=[\t ]*\()/i,number:/(?:\b\d+(?:\.\d+)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b[%&!#]?/i,operator:/--|\+\+|>>=?|<<=?|<>|[-+*/\\<>]=?|[:^=?]|\b(?:and|mod|not|or)\b/i,punctuation:/[.,;()[\]{}]/,constant:/\b(?:LINE_NUM)\b/i},Prism.languages.brightscript["directive-statement"].inside.expression.inside=Prism.languages.brightscript; |
|||
@ -0,0 +1,48 @@ |
|||
Prism.languages.bro = { |
|||
|
|||
'comment': { |
|||
pattern: /(^|[^\\$])#.*/, |
|||
lookbehind: true, |
|||
inside: { |
|||
'italic': /\b(?:TODO|FIXME|XXX)\b/ |
|||
} |
|||
}, |
|||
|
|||
'string': { |
|||
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, |
|||
greedy: true |
|||
}, |
|||
|
|||
'boolean': /\b[TF]\b/, |
|||
|
|||
'function': { |
|||
pattern: /(?:function|hook|event) \w+(?:::\w+)?/, |
|||
inside: { |
|||
keyword: /^(?:function|hook|event)/ |
|||
} |
|||
}, |
|||
|
|||
'variable': { |
|||
pattern: /(?:global|local) \w+/i, |
|||
inside: { |
|||
keyword: /(?:global|local)/ |
|||
} |
|||
}, |
|||
|
|||
'builtin': /(?:@(?:load(?:-(?:sigs|plugin))?|unload|prefixes|ifn?def|else|(?:end)?if|DIR|FILENAME))|(?:&?(?:redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/, |
|||
|
|||
'constant': { |
|||
pattern: /const \w+/i, |
|||
inside: { |
|||
keyword: /const/ |
|||
} |
|||
}, |
|||
|
|||
'keyword': /\b(?:break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module|function)\b/, |
|||
|
|||
'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/, |
|||
|
|||
'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, |
|||
|
|||
'punctuation': /[{}[\];(),.:]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bro={comment:{pattern:/(^|[^\\$])#.*/,lookbehind:!0,inside:{italic:/\b(?:TODO|FIXME|XXX)\b/}},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},boolean:/\b[TF]\b/,function:{pattern:/(?:function|hook|event) \w+(?:::\w+)?/,inside:{keyword:/^(?:function|hook|event)/}},variable:{pattern:/(?:global|local) \w+/i,inside:{keyword:/(?:global|local)/}},builtin:/(?:@(?:load(?:-(?:sigs|plugin))?|unload|prefixes|ifn?def|else|(?:end)?if|DIR|FILENAME))|(?:&?(?:redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/,constant:{pattern:/const \w+/i,inside:{keyword:/const/}},keyword:/\b(?:break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module|function)\b/,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,punctuation:/[{}[\];(),.:]/}; |
|||
@ -0,0 +1,41 @@ |
|||
Prism.languages.c = Prism.languages.extend('clike', { |
|||
'comment': { |
|||
pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/, |
|||
greedy: true |
|||
}, |
|||
'class-name': { |
|||
pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+/, |
|||
lookbehind: true |
|||
}, |
|||
'keyword': /\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, |
|||
'function': /[a-z_]\w*(?=\s*\()/i, |
|||
'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/, |
|||
'number': /(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/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|[\s\S]))*/im, |
|||
lookbehind: true, |
|||
alias: 'property', |
|||
inside: { |
|||
// highlight the path of the include statement as a string
|
|||
'string': { |
|||
pattern: /(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/, |
|||
lookbehind: true |
|||
}, |
|||
// highlight macro directives as keywords
|
|||
'directive': { |
|||
pattern: /(#\s*)\b(?:define|defined|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|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/ |
|||
}); |
|||
|
|||
delete Prism.languages.c['boolean']; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+/,lookbehind:!0},keyword:/\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,function:/[a-z_]\w*(?=\s*\()/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/,number:/(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete Prism.languages.c.boolean; |
|||
@ -0,0 +1,27 @@ |
|||
Prism.languages.cil = { |
|||
'comment': /\/\/.*/, |
|||
|
|||
'string': { |
|||
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, |
|||
greedy: true |
|||
}, |
|||
|
|||
'directive': { |
|||
pattern: /(^|\W)\.[a-z]+(?=\s)/, |
|||
lookbehind: true, |
|||
alias: 'class-name' |
|||
}, |
|||
|
|||
// Actually an assembly reference
|
|||
'variable': /\[[\w\.]+\]/, |
|||
|
|||
|
|||
'keyword': /\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|iant|idispatch|implements|import|initonly|instance|u?int(?:8|16|32|64)?|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/, |
|||
|
|||
'function': /\b(?:(?:constrained|unaligned|volatile|readonly|tail|no)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.[0-9]+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.[0-9]+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|ldvirtftn|castclass|beq(?:\.s)?|mkrefany|localloc|ckfinite|rethrow|ldtoken|ldsflda|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stloc|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|clt|cgt|ceq|box|and|or|br)\b/, |
|||
|
|||
'boolean': /\b(?:true|false)\b/, |
|||
'number': /\b-?(?:0x[0-9a-fA-F]+|[0-9]+)(?:\.[0-9a-fA-F]+)?\b/i, |
|||
|
|||
'punctuation': /[{}[\];(),:=]|IL_[0-9A-Za-z]+/ |
|||
} |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.cil={comment:/\/\/.*/,string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},directive:{pattern:/(^|\W)\.[a-z]+(?=\s)/,lookbehind:!0,alias:"class-name"},variable:/\[[\w\.]+\]/,keyword:/\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|iant|idispatch|implements|import|initonly|instance|u?int(?:8|16|32|64)?|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/,function:/\b(?:(?:constrained|unaligned|volatile|readonly|tail|no)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.[0-9]+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.[0-9]+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|ldvirtftn|castclass|beq(?:\.s)?|mkrefany|localloc|ckfinite|rethrow|ldtoken|ldsflda|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stloc|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|clt|cgt|ceq|box|and|or|br)\b/,boolean:/\b(?:true|false)\b/,number:/\b-?(?:0x[0-9a-fA-F]+|[0-9]+)(?:\.[0-9a-fA-F]+)?\b/i,punctuation:/[{}[\];(),:=]|IL_[0-9A-Za-z]+/}; |
|||
@ -0,0 +1,30 @@ |
|||
Prism.languages.clike = { |
|||
'comment': [ |
|||
{ |
|||
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, |
|||
lookbehind: true |
|||
}, |
|||
{ |
|||
pattern: /(^|[^\\:])\/\/.*/, |
|||
lookbehind: true, |
|||
greedy: 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+|\bcatch\s+\()[\w.\\]+/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': /\w+(?=\()/, |
|||
'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, |
|||
'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, |
|||
'punctuation': /[{}[\];(),.:]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,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:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}; |
|||
@ -0,0 +1,16 @@ |
|||
// Copied from https://github.com/jeluard/prism-clojure
|
|||
Prism.languages.clojure = { |
|||
'comment': /;.*/, |
|||
'string': { |
|||
pattern: /"(?:[^"\\]|\\.)*"/, |
|||
greedy: true |
|||
}, |
|||
'operator': /(?:::|[:|'])\b[a-z][\w*+!?-]*\b/i, //used for symbols and keywords
|
|||
'keyword': { |
|||
pattern: /([^\w+*'?-])(?:def|if|do|let|\.\.|quote|var|->>|->|fn|loop|recur|throw|try|monitor-enter|\.|new|set!|def\-|defn|defn\-|defmacro|defmulti|defmethod|defstruct|defonce|declare|definline|definterface|defprotocol|==|defrecord|>=|deftype|<=|defproject|ns|\*|\+|\-|\/|<|=|>|accessor|agent|agent-errors|aget|alength|all-ns|alter|and|append-child|apply|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|await|await-for|bean|binding|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|boolean|branch\?|butlast|byte|cast|char|children|class|clear-agent-errors|comment|commute|comp|comparator|complement|concat|conj|cons|constantly|cond|if-not|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|deref|difference|disj|dissoc|distinct|doall|doc|dorun|doseq|dosync|dotimes|doto|double|down|drop|drop-while|edit|end\?|ensure|eval|every\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|float|flush|for|fnseq|frest|gensym|get-proxy-class|get|hash-map|hash-set|identical\?|identity|if-let|import|in-ns|inc|index|insert-child|insert-left|insert-right|inspect-table|inspect-tree|instance\?|int|interleave|intersection|into|into-array|iterate|join|key|keys|keyword|keyword\?|last|lazy-cat|lazy-cons|left|lefts|line-seq|list\*|list|load|load-file|locking|long|loop|macroexpand|macroexpand-1|make-array|make-node|map|map-invert|map\?|mapcat|max|max-key|memfn|merge|merge-with|meta|min|min-key|name|namespace|neg\?|new|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unmap|nth|nthrest|or|parse|partial|path|peek|pop|pos\?|pr|pr-str|print|print-str|println|println-str|prn|prn-str|project|proxy|proxy-mappings|quot|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|reduce|ref|ref-set|refer|rem|remove|remove-method|remove-ns|rename|rename-keys|repeat|replace|replicate|resolve|rest|resultset-seq|reverse|rfirst|right|rights|root|rrest|rseq|second|select|select-keys|send|send-off|seq|seq-zip|seq\?|set|short|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|special-symbol\?|split-at|split-with|str|string\?|struct|struct-map|subs|subvec|symbol|symbol\?|sync|take|take-nth|take-while|test|time|to-array|to-array-2d|tree-seq|true\?|union|up|update-proxy|val|vals|var-get|var-set|var\?|vector|vector-zip|vector\?|when|when-first|when-let|when-not|with-local-vars|with-meta|with-open|with-out-str|xml-seq|xml-zip|zero\?|zipmap|zipper)(?=[^\w+*'?-])/, |
|||
lookbehind: true |
|||
}, |
|||
'boolean': /\b(?:true|false|nil)\b/, |
|||
'number': /\b[\da-f]+\b/i, |
|||
'punctuation': /[{}\[\](),]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.clojure={comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},operator:/(?:::|[:|'])\b[a-z][\w*+!?-]*\b/i,keyword:{pattern:/([^\w+*'?-])(?:def|if|do|let|\.\.|quote|var|->>|->|fn|loop|recur|throw|try|monitor-enter|\.|new|set!|def\-|defn|defn\-|defmacro|defmulti|defmethod|defstruct|defonce|declare|definline|definterface|defprotocol|==|defrecord|>=|deftype|<=|defproject|ns|\*|\+|\-|\/|<|=|>|accessor|agent|agent-errors|aget|alength|all-ns|alter|and|append-child|apply|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|await|await-for|bean|binding|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|boolean|branch\?|butlast|byte|cast|char|children|class|clear-agent-errors|comment|commute|comp|comparator|complement|concat|conj|cons|constantly|cond|if-not|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|deref|difference|disj|dissoc|distinct|doall|doc|dorun|doseq|dosync|dotimes|doto|double|down|drop|drop-while|edit|end\?|ensure|eval|every\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|float|flush|for|fnseq|frest|gensym|get-proxy-class|get|hash-map|hash-set|identical\?|identity|if-let|import|in-ns|inc|index|insert-child|insert-left|insert-right|inspect-table|inspect-tree|instance\?|int|interleave|intersection|into|into-array|iterate|join|key|keys|keyword|keyword\?|last|lazy-cat|lazy-cons|left|lefts|line-seq|list\*|list|load|load-file|locking|long|loop|macroexpand|macroexpand-1|make-array|make-node|map|map-invert|map\?|mapcat|max|max-key|memfn|merge|merge-with|meta|min|min-key|name|namespace|neg\?|new|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unmap|nth|nthrest|or|parse|partial|path|peek|pop|pos\?|pr|pr-str|print|print-str|println|println-str|prn|prn-str|project|proxy|proxy-mappings|quot|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|reduce|ref|ref-set|refer|rem|remove|remove-method|remove-ns|rename|rename-keys|repeat|replace|replicate|resolve|rest|resultset-seq|reverse|rfirst|right|rights|root|rrest|rseq|second|select|select-keys|send|send-off|seq|seq-zip|seq\?|set|short|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|special-symbol\?|split-at|split-with|str|string\?|struct|struct-map|subs|subvec|symbol|symbol\?|sync|take|take-nth|take-while|test|time|to-array|to-array-2d|tree-seq|true\?|union|up|update-proxy|val|vals|var-get|var-set|var\?|vector|vector-zip|vector\?|when|when-first|when-let|when-not|with-local-vars|with-meta|with-open|with-out-str|xml-seq|xml-zip|zero\?|zipmap|zipper)(?=[^\w+*'?-])/,lookbehind:!0},boolean:/\b(?:true|false|nil)\b/,number:/\b[\da-f]+\b/i,punctuation:/[{}\[\](),]/}; |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,92 @@ |
|||
(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: /'(?:\\[\s\S]|[^\\'])*'/, |
|||
greedy: true |
|||
}, |
|||
|
|||
{ |
|||
// Strings are multiline
|
|||
pattern: /"(?:\\[\s\S]|[^\\"])*"/, |
|||
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.languages.coffee = Prism.languages.coffeescript; |
|||
}(Prism)); |
|||
@ -0,0 +1 @@ |
|||
!function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],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"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},rest:e.languages.javascript}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(Prism); |
|||
@ -0,0 +1,48 @@ |
|||
Prism.languages.concurnas = { |
|||
'comment': [ |
|||
{ |
|||
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, |
|||
lookbehind: true |
|||
}, |
|||
{ |
|||
pattern: /(^|[^\\:])\/\/.*/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
} |
|||
], |
|||
'langext': { |
|||
pattern: /\w+\s*\|\|[\s\S]+?\|\|/, |
|||
greedy: true, |
|||
alias: 'string' |
|||
}, |
|||
'function': { |
|||
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/, |
|||
lookbehind: true |
|||
}, |
|||
'keyword': /\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/, |
|||
'boolean': /\b(?:false|true)\b/, |
|||
'number': /\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i, |
|||
'punctuation': /[{}[\];(),.:]/, |
|||
'operator': /<==|>==|=>|->|<-|<>|\^|&==|&<>|!|\?|\?:|\.\?|\+\+|--|[-+*/=<>]=?|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/, |
|||
'annotation': { |
|||
pattern: /@(?:\w+:)?(?:\w*|\[[^\]]+\])/, |
|||
alias: 'builtin' |
|||
} |
|||
}; |
|||
|
|||
Prism.languages.insertBefore('concurnas', 'langext', { |
|||
'string': { |
|||
pattern: /[rs]?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, |
|||
greedy: true, |
|||
inside: { |
|||
'interpolation': { |
|||
pattern: /((?:^|[^\\])(?:\\{2})*){(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/, |
|||
lookbehind: true, |
|||
inside: Prism.languages.concurnas |
|||
}, |
|||
'string': /[\s\S]+/ |
|||
} |
|||
} |
|||
}); |
|||
|
|||
Prism.languages.conc = Prism.languages.concurnas; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.concurnas={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],langext:{pattern:/\w+\s*\|\|[\s\S]+?\|\|/,greedy:!0,alias:"string"},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,lookbehind:!0},keyword:/\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/,boolean:/\b(?:false|true)\b/,number:/\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,punctuation:/[{}[\];(),.:]/,operator:/<==|>==|=>|->|<-|<>|\^|&==|&<>|!|\?|\?:|\.\?|\+\+|--|[-+*/=<>]=?|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,annotation:{pattern:/@(?:\w+:)?(?:\w*|\[[^\]]+\])/,alias:"builtin"}},Prism.languages.insertBefore("concurnas","langext",{string:{pattern:/[rs]?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*){(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:Prism.languages.concurnas},string:/[\s\S]+/}}}),Prism.languages.conc=Prism.languages.concurnas; |
|||
@ -0,0 +1,725 @@ |
|||
var _self = (typeof window !== 'undefined') |
|||
? window // if in browser
|
|||
: ( |
|||
(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) |
|||
? self // if in worker
|
|||
: {} // if in node js
|
|||
); |
|||
|
|||
/** |
|||
* Prism: Lightweight, robust, elegant syntax highlighting |
|||
* MIT license http://www.opensource.org/licenses/mit-license.php/
|
|||
* @author Lea Verou http://lea.verou.me
|
|||
*/ |
|||
|
|||
var Prism = (function (_self){ |
|||
|
|||
// Private helper vars
|
|||
var lang = /\blang(?:uage)?-([\w-]+)\b/i; |
|||
var uniqueId = 0; |
|||
|
|||
|
|||
var _ = { |
|||
manual: _self.Prism && _self.Prism.manual, |
|||
disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, |
|||
util: { |
|||
encode: function encode(tokens) { |
|||
if (tokens instanceof Token) { |
|||
return new Token(tokens.type, encode(tokens.content), tokens.alias); |
|||
} else if (Array.isArray(tokens)) { |
|||
return tokens.map(encode); |
|||
} else { |
|||
return tokens.replace(/&/g, '&').replace(/</g, '<').replace(/\u00a0/g, ' '); |
|||
} |
|||
}, |
|||
|
|||
type: function (o) { |
|||
return Object.prototype.toString.call(o).slice(8, -1); |
|||
}, |
|||
|
|||
objId: function (obj) { |
|||
if (!obj['__id']) { |
|||
Object.defineProperty(obj, '__id', { value: ++uniqueId }); |
|||
} |
|||
return obj['__id']; |
|||
}, |
|||
|
|||
// Deep clone a language definition (e.g. to extend it)
|
|||
clone: function deepClone(o, visited) { |
|||
var clone, id, type = _.util.type(o); |
|||
visited = visited || {}; |
|||
|
|||
switch (type) { |
|||
case 'Object': |
|||
id = _.util.objId(o); |
|||
if (visited[id]) { |
|||
return visited[id]; |
|||
} |
|||
clone = {}; |
|||
visited[id] = clone; |
|||
|
|||
for (var key in o) { |
|||
if (o.hasOwnProperty(key)) { |
|||
clone[key] = deepClone(o[key], visited); |
|||
} |
|||
} |
|||
|
|||
return clone; |
|||
|
|||
case 'Array': |
|||
id = _.util.objId(o); |
|||
if (visited[id]) { |
|||
return visited[id]; |
|||
} |
|||
clone = []; |
|||
visited[id] = clone; |
|||
|
|||
o.forEach(function (v, i) { |
|||
clone[i] = deepClone(v, visited); |
|||
}); |
|||
|
|||
return clone; |
|||
|
|||
default: |
|||
return o; |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class. |
|||
* |
|||
* If no language is set for the element or the element is `null` or `undefined`, `none` will be returned. |
|||
* |
|||
* @param {Element} element |
|||
* @returns {string} |
|||
*/ |
|||
getLanguage: function (element) { |
|||
while (element && !lang.test(element.className)) { |
|||
element = element.parentElement; |
|||
} |
|||
if (element) { |
|||
return (element.className.match(lang) || [, 'none'])[1].toLowerCase(); |
|||
} |
|||
return 'none'; |
|||
}, |
|||
|
|||
/** |
|||
* Returns the script element that is currently executing. |
|||
* |
|||
* This does __not__ work for line script element. |
|||
* |
|||
* @returns {HTMLScriptElement | null} |
|||
*/ |
|||
currentScript: function () { |
|||
if (typeof document === 'undefined') { |
|||
return null; |
|||
} |
|||
if ('currentScript' in document) { |
|||
return document.currentScript; |
|||
} |
|||
|
|||
// IE11 workaround
|
|||
// we'll get the src of the current script by parsing IE11's error stack trace
|
|||
// this will not work for inline scripts
|
|||
|
|||
try { |
|||
throw new Error(); |
|||
} catch (err) { |
|||
// Get file src url from stack. Specifically works with the format of stack traces in IE.
|
|||
// A stack will look like this:
|
|||
//
|
|||
// Error
|
|||
// at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
|
|||
// at Global code (http://localhost/components/prism-core.js:606:1)
|
|||
|
|||
var src = (/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(err.stack) || [])[1]; |
|||
if (src) { |
|||
var scripts = document.getElementsByTagName('script'); |
|||
for (var i in scripts) { |
|||
if (scripts[i].src == src) { |
|||
return scripts[i]; |
|||
} |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
}, |
|||
|
|||
languages: { |
|||
extend: function (id, redef) { |
|||
var lang = _.util.clone(_.languages[id]); |
|||
|
|||
for (var key in redef) { |
|||
lang[key] = redef[key]; |
|||
} |
|||
|
|||
return lang; |
|||
}, |
|||
|
|||
/** |
|||
* Insert a token before another token in a language literal |
|||
* As this needs to recreate the object (we cannot actually insert before keys in object literals), |
|||
* we cannot just provide an object, we need an object and a key. |
|||
* @param inside The key (or language id) of the parent |
|||
* @param before The key to insert before. |
|||
* @param insert Object with the key/value pairs to insert |
|||
* @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted. |
|||
*/ |
|||
insertBefore: function (inside, before, insert, root) { |
|||
root = root || _.languages; |
|||
var grammar = root[inside]; |
|||
var ret = {}; |
|||
|
|||
for (var token in grammar) { |
|||
if (grammar.hasOwnProperty(token)) { |
|||
|
|||
if (token == before) { |
|||
for (var newToken in insert) { |
|||
if (insert.hasOwnProperty(newToken)) { |
|||
ret[newToken] = insert[newToken]; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Do not insert token which also occur in insert. See #1525
|
|||
if (!insert.hasOwnProperty(token)) { |
|||
ret[token] = grammar[token]; |
|||
} |
|||
} |
|||
} |
|||
|
|||
var old = root[inside]; |
|||
root[inside] = ret; |
|||
|
|||
// Update references in other language definitions
|
|||
_.languages.DFS(_.languages, function(key, value) { |
|||
if (value === old && key != inside) { |
|||
this[key] = ret; |
|||
} |
|||
}); |
|||
|
|||
return ret; |
|||
}, |
|||
|
|||
// Traverse a language definition with Depth First Search
|
|||
DFS: function DFS(o, callback, type, visited) { |
|||
visited = visited || {}; |
|||
|
|||
var objId = _.util.objId; |
|||
|
|||
for (var i in o) { |
|||
if (o.hasOwnProperty(i)) { |
|||
callback.call(o, i, o[i], type || i); |
|||
|
|||
var property = o[i], |
|||
propertyType = _.util.type(property); |
|||
|
|||
if (propertyType === 'Object' && !visited[objId(property)]) { |
|||
visited[objId(property)] = true; |
|||
DFS(property, callback, null, visited); |
|||
} |
|||
else if (propertyType === 'Array' && !visited[objId(property)]) { |
|||
visited[objId(property)] = true; |
|||
DFS(property, callback, i, visited); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
plugins: {}, |
|||
|
|||
highlightAll: function(async, callback) { |
|||
_.highlightAllUnder(document, async, callback); |
|||
}, |
|||
|
|||
highlightAllUnder: function(container, async, callback) { |
|||
var env = { |
|||
callback: callback, |
|||
container: container, |
|||
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' |
|||
}; |
|||
|
|||
_.hooks.run('before-highlightall', env); |
|||
|
|||
env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector)); |
|||
|
|||
_.hooks.run('before-all-elements-highlight', env); |
|||
|
|||
for (var i = 0, element; element = env.elements[i++];) { |
|||
_.highlightElement(element, async === true, env.callback); |
|||
} |
|||
}, |
|||
|
|||
highlightElement: function(element, async, callback) { |
|||
// Find language
|
|||
var language = _.util.getLanguage(element); |
|||
var grammar = _.languages[language]; |
|||
|
|||
// Set language on the element, if not present
|
|||
element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; |
|||
|
|||
// Set language on the parent, for styling
|
|||
var parent = element.parentNode; |
|||
if (parent && parent.nodeName.toLowerCase() === 'pre') { |
|||
parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; |
|||
} |
|||
|
|||
var code = element.textContent; |
|||
|
|||
var env = { |
|||
element: element, |
|||
language: language, |
|||
grammar: grammar, |
|||
code: code |
|||
}; |
|||
|
|||
function insertHighlightedCode(highlightedCode) { |
|||
env.highlightedCode = highlightedCode; |
|||
|
|||
_.hooks.run('before-insert', env); |
|||
|
|||
env.element.innerHTML = env.highlightedCode; |
|||
|
|||
_.hooks.run('after-highlight', env); |
|||
_.hooks.run('complete', env); |
|||
callback && callback.call(env.element); |
|||
} |
|||
|
|||
_.hooks.run('before-sanity-check', env); |
|||
|
|||
if (!env.code) { |
|||
_.hooks.run('complete', env); |
|||
callback && callback.call(env.element); |
|||
return; |
|||
} |
|||
|
|||
_.hooks.run('before-highlight', env); |
|||
|
|||
if (!env.grammar) { |
|||
insertHighlightedCode(_.util.encode(env.code)); |
|||
return; |
|||
} |
|||
|
|||
if (async && _self.Worker) { |
|||
var worker = new Worker(_.filename); |
|||
|
|||
worker.onmessage = function(evt) { |
|||
insertHighlightedCode(evt.data); |
|||
}; |
|||
|
|||
worker.postMessage(JSON.stringify({ |
|||
language: env.language, |
|||
code: env.code, |
|||
immediateClose: true |
|||
})); |
|||
} |
|||
else { |
|||
insertHighlightedCode(_.highlight(env.code, env.grammar, env.language)); |
|||
} |
|||
}, |
|||
|
|||
highlight: function (text, grammar, language) { |
|||
var env = { |
|||
code: text, |
|||
grammar: grammar, |
|||
language: language |
|||
}; |
|||
_.hooks.run('before-tokenize', env); |
|||
env.tokens = _.tokenize(env.code, env.grammar); |
|||
_.hooks.run('after-tokenize', env); |
|||
return Token.stringify(_.util.encode(env.tokens), env.language); |
|||
}, |
|||
|
|||
tokenize: function(text, grammar) { |
|||
var rest = grammar.rest; |
|||
if (rest) { |
|||
for (var token in rest) { |
|||
grammar[token] = rest[token]; |
|||
} |
|||
|
|||
delete grammar.rest; |
|||
} |
|||
|
|||
var tokenList = new LinkedList(); |
|||
addAfter(tokenList, tokenList.head, text); |
|||
|
|||
matchGrammar(text, tokenList, grammar, tokenList.head, 0); |
|||
|
|||
return toArray(tokenList); |
|||
}, |
|||
|
|||
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); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
Token: Token |
|||
}; |
|||
|
|||
_self.Prism = _; |
|||
|
|||
function Token(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 stringify(o, language) { |
|||
if (typeof o == 'string') { |
|||
return o; |
|||
} |
|||
if (Array.isArray(o)) { |
|||
var s = ''; |
|||
o.forEach(function (e) { |
|||
s += stringify(e, language); |
|||
}); |
|||
return s; |
|||
} |
|||
|
|||
var env = { |
|||
type: o.type, |
|||
content: stringify(o.content, language), |
|||
tag: 'span', |
|||
classes: ['token', o.type], |
|||
attributes: {}, |
|||
language: language |
|||
}; |
|||
|
|||
var aliases = o.alias; |
|||
if (aliases) { |
|||
if (Array.isArray(aliases)) { |
|||
Array.prototype.push.apply(env.classes, aliases); |
|||
} else { |
|||
env.classes.push(aliases); |
|||
} |
|||
} |
|||
|
|||
_.hooks.run('wrap', env); |
|||
|
|||
var attributes = ''; |
|||
for (var name in env.attributes) { |
|||
attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '"') + '"'; |
|||
} |
|||
|
|||
return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>'; |
|||
}; |
|||
|
|||
/** |
|||
* @param {string} text |
|||
* @param {LinkedList<string | Token>} tokenList |
|||
* @param {any} grammar |
|||
* @param {LinkedListNode<string | Token>} startNode |
|||
* @param {number} startPos |
|||
* @param {boolean} [oneshot=false] |
|||
* @param {string} [target] |
|||
*/ |
|||
function matchGrammar(text, tokenList, grammar, startNode, startPos, oneshot, target) { |
|||
for (var token in grammar) { |
|||
if (!grammar.hasOwnProperty(token) || !grammar[token]) { |
|||
continue; |
|||
} |
|||
|
|||
var patterns = grammar[token]; |
|||
patterns = Array.isArray(patterns) ? patterns : [patterns]; |
|||
|
|||
for (var j = 0; j < patterns.length; ++j) { |
|||
if (target && target == token + ',' + j) { |
|||
return; |
|||
} |
|||
|
|||
var pattern = patterns[j], |
|||
inside = pattern.inside, |
|||
lookbehind = !!pattern.lookbehind, |
|||
greedy = !!pattern.greedy, |
|||
lookbehindLength = 0, |
|||
alias = pattern.alias; |
|||
|
|||
if (greedy && !pattern.pattern.global) { |
|||
// Without the global flag, lastIndex won't work
|
|||
var flags = pattern.pattern.toString().match(/[imsuy]*$/)[0]; |
|||
pattern.pattern = RegExp(pattern.pattern.source, flags + 'g'); |
|||
} |
|||
|
|||
pattern = pattern.pattern || pattern; |
|||
|
|||
for ( // iterate the token list and keep track of the current token/string position
|
|||
var currentNode = startNode.next, pos = startPos; |
|||
currentNode !== tokenList.tail; |
|||
pos += currentNode.value.length, currentNode = currentNode.next |
|||
) { |
|||
|
|||
var str = currentNode.value; |
|||
|
|||
if (tokenList.length > text.length) { |
|||
// Something went terribly wrong, ABORT, ABORT!
|
|||
return; |
|||
} |
|||
|
|||
if (str instanceof Token) { |
|||
continue; |
|||
} |
|||
|
|||
var removeCount = 1; // this is the to parameter of removeBetween
|
|||
|
|||
if (greedy && currentNode != tokenList.tail.prev) { |
|||
pattern.lastIndex = pos; |
|||
var match = pattern.exec(text); |
|||
if (!match) { |
|||
break; |
|||
} |
|||
|
|||
var from = match.index + (lookbehind && match[1] ? match[1].length : 0); |
|||
var to = match.index + match[0].length; |
|||
var p = pos; |
|||
|
|||
// find the node that contains the match
|
|||
p += currentNode.value.length; |
|||
while (from >= p) { |
|||
currentNode = currentNode.next; |
|||
p += currentNode.value.length; |
|||
} |
|||
// adjust pos (and p)
|
|||
p -= currentNode.value.length; |
|||
pos = p; |
|||
|
|||
// the current node is a Token, then the match starts inside another Token, which is invalid
|
|||
if (currentNode.value instanceof Token) { |
|||
continue; |
|||
} |
|||
|
|||
// find the last node which is affected by this match
|
|||
for ( |
|||
var k = currentNode; |
|||
k !== tokenList.tail && (p < to || (typeof k.value === 'string' && !k.prev.value.greedy)); |
|||
k = k.next |
|||
) { |
|||
removeCount++; |
|||
p += k.value.length; |
|||
} |
|||
removeCount--; |
|||
|
|||
// replace with the new match
|
|||
str = text.slice(pos, p); |
|||
match.index -= pos; |
|||
} else { |
|||
pattern.lastIndex = 0; |
|||
|
|||
var match = pattern.exec(str); |
|||
} |
|||
|
|||
if (!match) { |
|||
if (oneshot) { |
|||
break; |
|||
} |
|||
|
|||
continue; |
|||
} |
|||
|
|||
if (lookbehind) { |
|||
lookbehindLength = match[1] ? match[1].length : 0; |
|||
} |
|||
|
|||
var from = match.index + lookbehindLength, |
|||
match = match[0].slice(lookbehindLength), |
|||
to = from + match.length, |
|||
before = str.slice(0, from), |
|||
after = str.slice(to); |
|||
|
|||
var removeFrom = currentNode.prev; |
|||
|
|||
if (before) { |
|||
removeFrom = addAfter(tokenList, removeFrom, before); |
|||
pos += before.length; |
|||
} |
|||
|
|||
removeRange(tokenList, removeFrom, removeCount); |
|||
|
|||
var wrapped = new Token(token, inside ? _.tokenize(match, inside) : match, alias, match, greedy); |
|||
currentNode = addAfter(tokenList, removeFrom, wrapped); |
|||
|
|||
if (after) { |
|||
addAfter(tokenList, currentNode, after); |
|||
} |
|||
|
|||
|
|||
if (removeCount > 1) |
|||
matchGrammar(text, tokenList, grammar, currentNode.prev, pos, true, token + ',' + j); |
|||
|
|||
if (oneshot) |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @typedef LinkedListNode |
|||
* @property {T} value |
|||
* @property {LinkedListNode<T> | null} prev The previous node. |
|||
* @property {LinkedListNode<T> | null} next The next node. |
|||
* @template T |
|||
*/ |
|||
|
|||
/** |
|||
* @template T |
|||
*/ |
|||
function LinkedList() { |
|||
/** @type {LinkedListNode<T>} */ |
|||
var head = { value: null, prev: null, next: null }; |
|||
/** @type {LinkedListNode<T>} */ |
|||
var tail = { value: null, prev: head, next: null }; |
|||
head.next = tail; |
|||
|
|||
/** @type {LinkedListNode<T>} */ |
|||
this.head = head; |
|||
/** @type {LinkedListNode<T>} */ |
|||
this.tail = tail; |
|||
this.length = 0; |
|||
} |
|||
|
|||
/** |
|||
* Adds a new node with the given value to the list. |
|||
* @param {LinkedList<T>} list |
|||
* @param {LinkedListNode<T>} node |
|||
* @param {T} value |
|||
* @returns {LinkedListNode<T>} The added node. |
|||
* @template T |
|||
*/ |
|||
function addAfter(list, node, value) { |
|||
// assumes that node != list.tail && values.length >= 0
|
|||
var next = node.next; |
|||
|
|||
var newNode = { value: value, prev: node, next: next }; |
|||
node.next = newNode; |
|||
next.prev = newNode; |
|||
list.length++; |
|||
|
|||
return newNode; |
|||
} |
|||
/** |
|||
* Removes `count` nodes after the given node. The given node will not be removed. |
|||
* @param {LinkedList<T>} list |
|||
* @param {LinkedListNode<T>} node |
|||
* @param {number} count |
|||
* @template T |
|||
*/ |
|||
function removeRange(list, node, count) { |
|||
var next = node.next; |
|||
for (var i = 0; i < count && next !== list.tail; i++) { |
|||
next = next.next; |
|||
} |
|||
node.next = next; |
|||
next.prev = node; |
|||
list.length -= i; |
|||
} |
|||
/** |
|||
* @param {LinkedList<T>} list |
|||
* @returns {T[]} |
|||
* @template T |
|||
*/ |
|||
function toArray(list) { |
|||
var array = []; |
|||
var node = list.head.next; |
|||
while (node !== list.tail) { |
|||
array.push(node.value); |
|||
node = node.next; |
|||
} |
|||
return array; |
|||
} |
|||
|
|||
|
|||
if (!_self.document) { |
|||
if (!_self.addEventListener) { |
|||
// in Node.js
|
|||
return _; |
|||
} |
|||
|
|||
if (!_.disableWorkerMessageHandler) { |
|||
// In worker
|
|||
_self.addEventListener('message', function (evt) { |
|||
var message = JSON.parse(evt.data), |
|||
lang = message.language, |
|||
code = message.code, |
|||
immediateClose = message.immediateClose; |
|||
|
|||
_self.postMessage(_.highlight(code, _.languages[lang], lang)); |
|||
if (immediateClose) { |
|||
_self.close(); |
|||
} |
|||
}, false); |
|||
} |
|||
|
|||
return _; |
|||
} |
|||
|
|||
//Get current script and highlight
|
|||
var script = _.util.currentScript(); |
|||
|
|||
if (script) { |
|||
_.filename = script.src; |
|||
|
|||
if (script.hasAttribute('data-manual')) { |
|||
_.manual = true; |
|||
} |
|||
} |
|||
|
|||
function highlightAutomaticallyCallback() { |
|||
if (!_.manual) { |
|||
_.highlightAll(); |
|||
} |
|||
} |
|||
|
|||
if (!_.manual) { |
|||
// If the document state is "loading", then we'll use DOMContentLoaded.
|
|||
// If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
|
|||
// DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
|
|||
// might take longer one animation frame to execute which can create a race condition where only some plugins have
|
|||
// been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
|
|||
// See https://github.com/PrismJS/prism/issues/2102
|
|||
var readyState = document.readyState; |
|||
if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) { |
|||
document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback); |
|||
} else { |
|||
if (window.requestAnimationFrame) { |
|||
window.requestAnimationFrame(highlightAutomaticallyCallback); |
|||
} else { |
|||
window.setTimeout(highlightAutomaticallyCallback, 16); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return _; |
|||
|
|||
})(_self); |
|||
|
|||
if (typeof module !== 'undefined' && module.exports) { |
|||
module.exports = Prism; |
|||
} |
|||
|
|||
// hack for components to work correctly in node.js
|
|||
if (typeof global !== 'undefined') { |
|||
global.Prism = Prism; |
|||
} |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,21 @@ |
|||
Prism.languages.cpp = Prism.languages.extend('c', { |
|||
'class-name': { |
|||
pattern: /(\b(?:class|enum|struct)\s+)\w+/, |
|||
lookbehind: true |
|||
}, |
|||
'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, |
|||
'number': { |
|||
pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i, |
|||
greedy: true |
|||
}, |
|||
'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, |
|||
'boolean': /\b(?:true|false)\b/ |
|||
}); |
|||
|
|||
Prism.languages.insertBefore('cpp', 'string', { |
|||
'raw-string': { |
|||
pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, |
|||
alias: 'string', |
|||
greedy: true |
|||
} |
|||
}); |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.cpp=Prism.languages.extend("c",{"class-name":{pattern:/(\b(?:class|enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i,greedy:!0},operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:true|false)\b/}),Prism.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}); |
|||
@ -0,0 +1,51 @@ |
|||
(function(Prism) { |
|||
Prism.languages.crystal = Prism.languages.extend('ruby', { |
|||
keyword: [ |
|||
/\b(?:abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|rescue|return|require|select|self|sizeof|struct|super|then|type|typeof|uninitialized|union|unless|until|when|while|with|yield|__DIR__|__END_LINE__|__FILE__|__LINE__)\b/, |
|||
{ |
|||
pattern: /(\.\s*)(?:is_a|responds_to)\?/, |
|||
lookbehind: true |
|||
} |
|||
], |
|||
|
|||
number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/ |
|||
}); |
|||
|
|||
Prism.languages.insertBefore('crystal', 'string', { |
|||
attribute: { |
|||
pattern: /@\[.+?\]/, |
|||
alias: 'attr-name', |
|||
inside: { |
|||
delimiter: { |
|||
pattern: /^@\[|\]$/, |
|||
alias: 'tag' |
|||
}, |
|||
rest: Prism.languages.crystal |
|||
} |
|||
}, |
|||
|
|||
expansion: [ |
|||
{ |
|||
pattern: /\{\{.+?\}\}/, |
|||
inside: { |
|||
delimiter: { |
|||
pattern: /^\{\{|\}\}$/, |
|||
alias: 'tag' |
|||
}, |
|||
rest: Prism.languages.crystal |
|||
} |
|||
}, |
|||
{ |
|||
pattern: /\{%.+?%\}/, |
|||
inside: { |
|||
delimiter: { |
|||
pattern: /^\{%|%\}$/, |
|||
alias: 'tag' |
|||
}, |
|||
rest: Prism.languages.crystal |
|||
} |
|||
} |
|||
] |
|||
}); |
|||
|
|||
}(Prism)); |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue