Skip to content

Commit

Permalink
Reverted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Mar 30, 2019
1 parent 9463c5d commit 80de4f6
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 53 deletions.
31 changes: 17 additions & 14 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
},
"root": true,
"rules": {
"comma-dangle": [
"warn",
"only-multiline",
],
// "indent": [
// "error",
// "tab",
Expand All @@ -37,26 +41,19 @@
}
],
"no-useless-escape": "off",
// "quotes": [
// "warn",
// "single",
// {
// "avoidEscape": true,
// }
// ],
"semi": [
"error",
"always",
],
},
"overrides": [
{
"files": [
"components/*.js",
],
"rules": {
"quotes": [
"warn",
"single",
{
"avoidEscape": true,
}
],
},
},
{
"files": [
"components/prism-core.js",
Expand Down Expand Up @@ -90,6 +87,12 @@
"parserOptions": {
"ecmaVersion": 2015,
},
"rules": {
"comma-dangle": [
"error",
"always-multiline",
],
},
},
{
"files": [
Expand Down
6 changes: 3 additions & 3 deletions components/prism-abap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-aspnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:(
// match directives of attribute value foo="<% Bar %>"
Prism.languages.insertBefore('inside', 'punctuation', {
'directive tag': Prism.languages.aspnet['directive tag']
}, Prism.languages.aspnet.tag.inside['attr-value']);
}, Prism.languages.aspnet.tag.inside["attr-value"]);

Prism.languages.insertBefore('aspnet', 'comment', {
'asp comment': /<%--[\s\S]*?--%>/
Expand Down
24 changes: 12 additions & 12 deletions components/prism-autoit.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
Prism.languages.autoit = {
'comment': [
"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': {
"url": {
pattern: /(^\s*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,
lookbehind: true
},
'string': {
"string": {
pattern: /(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,
greedy: true,
inside: {
'variable': /([%$@])\w+\1/
"variable": /([%$@])\w+\1/
}
},
'directive': {
"directive": {
pattern: /(^\s*)#\w+/m,
lookbehind: true,
alias: 'keyword'
},
'function': /\b\w+(?=\()/,
"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': /[\[\]().,:]/
"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": /[\[\]().,:]/
};
12 changes: 6 additions & 6 deletions components/prism-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ var _ = {
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
};

_.hooks.run('before-highlightall', env);
_.hooks.run("before-highlightall", env);

var elements = env.elements || container.querySelectorAll(env.selector);

Expand Down Expand Up @@ -287,7 +287,7 @@ var _ = {
}

var patterns = grammar[token];
patterns = (_.util.type(patterns) === 'Array') ? patterns : [patterns];
patterns = (_.util.type(patterns) === "Array") ? patterns : [patterns];

for (var j = 0; j < patterns.length; ++j) {
var pattern = patterns[j],
Expand All @@ -300,7 +300,7 @@ var _ = {
if (greedy && !pattern.pattern.global) {
// Without the global flag, lastIndex won't work
var flags = pattern.pattern.toString().match(/[imuy]*$/)[0];
pattern.pattern = RegExp(pattern.pattern.source, flags + 'g');
pattern.pattern = RegExp(pattern.pattern.source, flags + "g");
}

pattern = pattern.pattern || pattern;
Expand Down Expand Up @@ -454,7 +454,7 @@ function Token(type, content, alias, matchedStr, greedy) {
this.content = content;
this.alias = alias;
// Copy of the full string this token was created from
this.length = (matchedStr || '').length|0;
this.length = (matchedStr || "").length|0;
this.greedy = !!greedy;
}

Expand Down Expand Up @@ -517,13 +517,13 @@ if (!_self.document) {
}

//Get current script and highlight
var script = document.currentScript || [].slice.call(document.getElementsByTagName('script')).pop();
var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop();

if (script) {
_.filename = script.src;

if (!_.manual && !script.hasAttribute('data-manual')) {
if(document.readyState !== 'loading') {
if(document.readyState !== "loading") {
if (window.requestAnimationFrame) {
window.requestAnimationFrame(_.highlightAll);
} else {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-kotlin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'operator': /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/
});

delete Prism.languages.kotlin['class-name'];
delete Prism.languages.kotlin["class-name"];

Prism.languages.insertBefore('kotlin', 'string', {
'raw-string': {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-less.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Prism.languages.insertBefore('less', 'property', {
{
pattern: /@[\w-]+\s*:/,
inside: {
'punctuation': /:/
"punctuation": /:/
}
},

Expand Down
2 changes: 1 addition & 1 deletion components/prism-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}
});

Prism.languages.insertBefore('inside', 'punctuation', {
parser = Prism.languages.insertBefore('inside', 'punctuation', {
'expression': parser.expression,
'keyword': parser.keyword,
'variable': parser.variable,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-parser.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions components/prism-smarty.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
// Value is made optional because it may have already been tokenized
pattern: /\w+\s*=\s*(?:(?!\d)\w+)?/,
inside: {
'variable': {
"variable": {
pattern: /(=\s*)(?!\d)\w+/,
lookbehind: true
},
'operator': /=/
"operator": /=/
}
},
'punctuation': [
Expand Down
4 changes: 2 additions & 2 deletions components/prism-toml.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
greedy: true
},
'table': {
pattern: RegExp('(\\[\\s*)' + key + '(?:\\s*\\.\\s*' + key + ')*(?=\\s*\\])'),
pattern: RegExp("(\\[\\s*)" + key + "(?:\\s*\\.\\s*" + key + ")*(?=\\s*\\])"),
lookbehind: true,
greedy: true,
alias: 'class-name'
},
'key': {
pattern: RegExp('(^\\s*|[{,]\\s*)' + key + '(?:\\s*\\.\\s*' + key + ')*(?=\\s*=)', 'm'),
pattern: RegExp("(^\\s*|[{,]\\s*)" + key + "(?:\\s*\\.\\s*" + key + ")*(?=\\s*=)", "m"),
lookbehind: true,
greedy: true,
alias: 'property'
Expand Down
2 changes: 1 addition & 1 deletion components/prism-vbnet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Prism.languages.vbnet = Prism.languages.extend('basic', {
Prism.languages.vbnet = Prism.languages.extend("basic", {
'keyword': /(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDEC|CDBL|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEFAULT|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LINE INPUT|LET|LIB|LIKE|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPERATOR|OPEN|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHORT|SINGLE|SHELL|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SYNCLOCK|SWAP|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,
'comment': [
{
Expand Down
2 changes: 1 addition & 1 deletion components/prism-xeora.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

Prism.languages.insertBefore('inside', 'punctuation', {
'variable': Prism.languages.xeora['function-inline'].inside['variable']
}, Prism.languages.xeora['function-block']);
}, Prism.languages.xeora["function-block"]);

Prism.languages.xeoracube = Prism.languages.xeora;

Expand Down
2 changes: 1 addition & 1 deletion components/prism-xquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'xquery-comment': {
pattern: /\(:[\s\S]*?:\)/,
greedy: true,
alias: 'comment'
alias: "comment"
},
'string': {
pattern: /(["'])(?:\1\1|(?!\1)[\s\S])*\1/,
Expand Down
12 changes: 6 additions & 6 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ var _ = {
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
};

_.hooks.run('before-highlightall', env);
_.hooks.run("before-highlightall", env);

var elements = env.elements || container.querySelectorAll(env.selector);

Expand Down Expand Up @@ -292,7 +292,7 @@ var _ = {
}

var patterns = grammar[token];
patterns = (_.util.type(patterns) === 'Array') ? patterns : [patterns];
patterns = (_.util.type(patterns) === "Array") ? patterns : [patterns];

for (var j = 0; j < patterns.length; ++j) {
var pattern = patterns[j],
Expand All @@ -305,7 +305,7 @@ var _ = {
if (greedy && !pattern.pattern.global) {
// Without the global flag, lastIndex won't work
var flags = pattern.pattern.toString().match(/[imuy]*$/)[0];
pattern.pattern = RegExp(pattern.pattern.source, flags + 'g');
pattern.pattern = RegExp(pattern.pattern.source, flags + "g");
}

pattern = pattern.pattern || pattern;
Expand Down Expand Up @@ -459,7 +459,7 @@ function Token(type, content, alias, matchedStr, greedy) {
this.content = content;
this.alias = alias;
// Copy of the full string this token was created from
this.length = (matchedStr || '').length|0;
this.length = (matchedStr || "").length|0;
this.greedy = !!greedy;
}

Expand Down Expand Up @@ -522,13 +522,13 @@ if (!_self.document) {
}

//Get current script and highlight
var script = document.currentScript || [].slice.call(document.getElementsByTagName('script')).pop();
var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop();

if (script) {
_.filename = script.src;

if (!_.manual && !script.hasAttribute('data-manual')) {
if(document.readyState !== 'loading') {
if(document.readyState !== "loading") {
if (window.requestAnimationFrame) {
window.requestAnimationFrame(_.highlightAll);
} else {
Expand Down

0 comments on commit 80de4f6

Please sign in to comment.