prism-rails 1.5.1 → 1.5.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prism-rails/version.rb +1 -1
- data/vendor/assets/javascripts/prism-ada.js +19 -0
- data/vendor/assets/javascripts/prism-apl.js +2 -2
- data/vendor/assets/javascripts/prism-asciidoc.js +4 -4
- data/vendor/assets/javascripts/prism-autolinker.js +32 -26
- data/vendor/assets/javascripts/prism-autoloader.js +5 -1
- data/vendor/assets/javascripts/prism-bash.js +2 -2
- data/vendor/assets/javascripts/prism-css-extras.js +2 -1
- data/vendor/assets/javascripts/prism-css.js +4 -1
- data/vendor/assets/javascripts/prism-data-uri-highlight.js +98 -0
- data/vendor/assets/javascripts/prism-graphql.js +24 -0
- data/vendor/assets/javascripts/prism-groovy.js +2 -2
- data/vendor/assets/javascripts/prism-javascript.js +2 -1
- data/vendor/assets/javascripts/prism-json.js +4 -4
- data/vendor/assets/javascripts/prism-line-highlight.js +16 -15
- data/vendor/assets/javascripts/prism-line-numbers.js +1 -0
- data/vendor/assets/javascripts/prism-livescript.js +118 -0
- data/vendor/assets/javascripts/prism-markup.js +2 -2
- data/vendor/assets/javascripts/prism-normalize-whitespace.js +1 -1
- data/vendor/assets/javascripts/prism-php.js +2 -1
- data/vendor/assets/javascripts/prism-powershell.js +2 -2
- data/vendor/assets/javascripts/prism-properties.js +9 -0
- data/vendor/assets/javascripts/prism-puppet.js +1 -1
- data/vendor/assets/javascripts/prism-remove-initial-line-feed.js +1 -1
- data/vendor/assets/javascripts/prism-ruby.js +1 -1
- data/vendor/assets/javascripts/prism-scss.js +18 -3
- data/vendor/assets/javascripts/prism-show-language.js +1 -1
- data/vendor/assets/javascripts/prism-textile.js +3 -0
- data/vendor/assets/javascripts/prism-wpd.js +48 -45
- data/vendor/assets/javascripts/prism-xojo.js +20 -0
- data/vendor/assets/javascripts/prism.js +8 -3
- data/vendor/assets/stylesheets/prism-base16-ateliersulphurpool.light.css +20 -0
- data/vendor/assets/stylesheets/prism-coy.css +0 -14
- data/vendor/assets/stylesheets/prism-duotone-dark.css +19 -0
- data/vendor/assets/stylesheets/prism-duotone-earth.css +20 -0
- data/vendor/assets/stylesheets/prism-duotone-forest.css +20 -0
- data/vendor/assets/stylesheets/prism-duotone-light.css +20 -0
- data/vendor/assets/stylesheets/prism-duotone-sea.css +20 -0
- data/vendor/assets/stylesheets/prism-duotone-space.css +20 -0
- data/vendor/assets/stylesheets/prism-line-highlight.css +0 -3
- data/vendor/assets/stylesheets/prism-previewer-angle.css +0 -2
- data/vendor/assets/stylesheets/prism-previewer-base.css +0 -15
- data/vendor/assets/stylesheets/prism-previewer-gradient.css +0 -6
- data/vendor/assets/stylesheets/prism-previewer-time.css +0 -2
- data/vendor/assets/stylesheets/prism-show-language.css +0 -2
- data/vendor/assets/stylesheets/prism-twilight.css +0 -3
- data/vendor/assets/stylesheets/prism-vs.css +27 -9
- metadata +9 -3
@@ -0,0 +1,118 @@
|
|
1
|
+
Prism.languages.livescript = {
|
2
|
+
'interpolated-string': {
|
3
|
+
pattern: /("""|")(?:\\[\s\S]|(?!\1)[^\\])*\1/,
|
4
|
+
greedy: true,
|
5
|
+
inside: {
|
6
|
+
'variable': {
|
7
|
+
pattern: /(^|[^\\])#[a-z_](?:-?[a-z]|\d)*/m,
|
8
|
+
lookbehind: true
|
9
|
+
},
|
10
|
+
'interpolation': {
|
11
|
+
pattern: /(^|[^\\])#\{[^}]+\}/m,
|
12
|
+
lookbehind: true,
|
13
|
+
inside: {
|
14
|
+
'interpolation-punctuation': {
|
15
|
+
pattern: /^#\{|\}$/,
|
16
|
+
alias: 'variable'
|
17
|
+
}
|
18
|
+
// See rest below
|
19
|
+
}
|
20
|
+
},
|
21
|
+
'string': /[\s\S]+/
|
22
|
+
}
|
23
|
+
},
|
24
|
+
'comment': [
|
25
|
+
{
|
26
|
+
pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
|
27
|
+
lookbehind: true,
|
28
|
+
greedy: true
|
29
|
+
},
|
30
|
+
{
|
31
|
+
pattern: /(^|[^\\])#.*/,
|
32
|
+
lookbehind: true,
|
33
|
+
greedy: true
|
34
|
+
}
|
35
|
+
],
|
36
|
+
'string': [
|
37
|
+
{
|
38
|
+
pattern: /('''|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,
|
39
|
+
greedy: true
|
40
|
+
},
|
41
|
+
{
|
42
|
+
pattern: /<\[[\s\S]*?\]>/,
|
43
|
+
greedy: true
|
44
|
+
},
|
45
|
+
/\\[^\s,;\])}]+/
|
46
|
+
],
|
47
|
+
'regex': [
|
48
|
+
{
|
49
|
+
pattern: /\/\/(\[.+?]|\\.|(?!\/\/)[^\\])+\/\/[gimyu]{0,5}/,
|
50
|
+
greedy: true,
|
51
|
+
inside: {
|
52
|
+
'comment': {
|
53
|
+
pattern: /(^|[^\\])#.*/,
|
54
|
+
lookbehind: true
|
55
|
+
}
|
56
|
+
}
|
57
|
+
},
|
58
|
+
{
|
59
|
+
pattern: /\/(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}/,
|
60
|
+
greedy: true
|
61
|
+
}
|
62
|
+
],
|
63
|
+
'keyword': {
|
64
|
+
pattern: /(^|(?!-).)\b(?:break|case|catch|class|const|continue|default|do|else|extends|fallthrough|finally|for(?: ever)?|function|if|implements|it|let|loop|new|null|otherwise|own|return|super|switch|that|then|this|throw|try|unless|until|var|void|when|while|yield)(?!-)\b/m,
|
65
|
+
lookbehind: true
|
66
|
+
},
|
67
|
+
'keyword-operator': {
|
68
|
+
pattern: /(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?:nt| not)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m,
|
69
|
+
lookbehind: true,
|
70
|
+
alias: 'operator'
|
71
|
+
},
|
72
|
+
'boolean': {
|
73
|
+
pattern: /(^|[^-])\b(?:false|no|off|on|true|yes)(?!-)\b/m,
|
74
|
+
lookbehind: true
|
75
|
+
},
|
76
|
+
'argument': {
|
77
|
+
// Don't match .&. nor &&
|
78
|
+
pattern: /(^|(?!\.&\.)[^&])&(?!&)\d*/m,
|
79
|
+
lookbehind: true,
|
80
|
+
alias: 'variable'
|
81
|
+
},
|
82
|
+
'number': /\b(?:\d+~[\da-z]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[a-z]\w*)?)/i,
|
83
|
+
'identifier': /[a-z_](?:-?[a-z]|\d)*/i,
|
84
|
+
'operator': [
|
85
|
+
// Spaced .
|
86
|
+
{
|
87
|
+
pattern: /( )\.(?= )/,
|
88
|
+
lookbehind: true
|
89
|
+
},
|
90
|
+
// Full list, in order:
|
91
|
+
// .= .~ .. ...
|
92
|
+
// .&. .^. .<<. .>>. .>>>.
|
93
|
+
// := :: ::=
|
94
|
+
// &&
|
95
|
+
// || |>
|
96
|
+
// < << <<< <<<<
|
97
|
+
// <- <-- <-! <--!
|
98
|
+
// <~ <~~ <~! <~~!
|
99
|
+
// <| <= <?
|
100
|
+
// > >> >= >?
|
101
|
+
// - -- -> -->
|
102
|
+
// + ++
|
103
|
+
// @ @@
|
104
|
+
// % %%
|
105
|
+
// * **
|
106
|
+
// ! != !~=
|
107
|
+
// !~> !~~>
|
108
|
+
// !-> !-->
|
109
|
+
// ~ ~> ~~> ~=
|
110
|
+
// = ==
|
111
|
+
// ^ ^^
|
112
|
+
// / ?
|
113
|
+
/\.(?:[=~]|\.\.?)|\.(?:[&|^]|<<|>>>?)\.|:(?:=|:=?)|&&|\|[|>]|<(?:<<?<?|--?!?|~~?!?|[|=?])?|>[>=?]?|-(?:->?|>)?|\+\+?|@@?|%%?|\*\*?|!(?:~?=|--?>|~?~>)?|~(?:~?>|=)?|==?|\^\^?|[\/?]/
|
114
|
+
],
|
115
|
+
'punctuation': /[(){}\[\]|.,:;`]/
|
116
|
+
};
|
117
|
+
|
118
|
+
Prism.languages.livescript['interpolated-string'].inside['interpolation'].inside.rest = Prism.languages.livescript;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
Prism.languages.markup = {
|
2
2
|
'comment': /<!--[\w\W]*?-->/,
|
3
3
|
'prolog': /<\?[\w\W]+?\?>/,
|
4
|
-
'doctype': /<!DOCTYPE[\w\W]
|
4
|
+
'doctype': /<!DOCTYPE[\w\W]+?>/i,
|
5
5
|
'cdata': /<!\[CDATA\[[\w\W]*?]]>/i,
|
6
6
|
'tag': {
|
7
|
-
pattern: /<\/?(?!\d)[^\s
|
7
|
+
pattern: /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,
|
8
8
|
inside: {
|
9
9
|
'tag': {
|
10
10
|
pattern: /^<\/?[^\s>\/]+/i,
|
@@ -126,7 +126,7 @@ Prism.plugins.NormalizeWhitespace = new NormalizeWhitespace({
|
|
126
126
|
'spaces-to-tabs': 4*/
|
127
127
|
});
|
128
128
|
|
129
|
-
Prism.hooks.add('before-
|
129
|
+
Prism.hooks.add('before-sanity-check', function (env) {
|
130
130
|
var pre = env.element.parentNode;
|
131
131
|
var clsReg = /\bno-whitespace-normalization\b/;
|
132
132
|
if (!env.code || !pre || pre.nodeName.toLowerCase() !== 'pre' ||
|
@@ -5,7 +5,7 @@ Prism.languages.powershell = {
|
|
5
5
|
lookbehind: true
|
6
6
|
},
|
7
7
|
{
|
8
|
-
pattern: /(^|[^`])
|
8
|
+
pattern: /(^|[^`])#.*/,
|
9
9
|
lookbehind: true
|
10
10
|
}
|
11
11
|
],
|
@@ -49,4 +49,4 @@ Prism.languages.powershell = {
|
|
49
49
|
// Variable interpolation inside strings, and nested expressions
|
50
50
|
Prism.languages.powershell.string[0].inside.boolean = Prism.languages.powershell.boolean;
|
51
51
|
Prism.languages.powershell.string[0].inside.variable = Prism.languages.powershell.variable;
|
52
|
-
Prism.languages.powershell.string[0].inside.function.inside = Prism.util.clone(Prism.languages.powershell);
|
52
|
+
Prism.languages.powershell.string[0].inside.function.inside = Prism.util.clone(Prism.languages.powershell);
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Prism.languages.properties = {
|
2
|
+
'comment': /^[ \t]*[#!].*$/m,
|
3
|
+
'attr-value': {
|
4
|
+
pattern: /(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+?(?: *[=:] *| ))(?:\\(?:\r\n|[\s\S])|.)+/m,
|
5
|
+
lookbehind: true
|
6
|
+
},
|
7
|
+
'attr-name': /^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+?(?= *[ =:]| )/m,
|
8
|
+
'punctuation': /[=:]/
|
9
|
+
};
|
@@ -41,7 +41,7 @@
|
|
41
41
|
},
|
42
42
|
'regex': {
|
43
43
|
// Must be prefixed with the keyword "node" or a non-word char
|
44
|
-
pattern: /((?:\bnode\s+|[
|
44
|
+
pattern: /((?:\bnode\s+|[~=\(\[\{,]\s*|[=+]>\s*|^\s*))\/(?:[^\/\\]|\\[\s\S])+\/(?:[imx]+\b|\B)/,
|
45
45
|
lookbehind: true,
|
46
46
|
inside: {
|
47
47
|
// Extended regexes must have the x flag. They can contain single-line comments.
|
@@ -4,7 +4,7 @@ if (typeof self === 'undefined' || !self.Prism || !self.document) {
|
|
4
4
|
return;
|
5
5
|
}
|
6
6
|
|
7
|
-
Prism.hooks.add('before-
|
7
|
+
Prism.hooks.add('before-sanity-check', function (env) {
|
8
8
|
if (env.code) {
|
9
9
|
var pre = env.element.parentNode;
|
10
10
|
var clsReg = /\s*\bkeep-initial-line-feed\b\s*/;
|
@@ -64,7 +64,7 @@
|
|
64
64
|
});
|
65
65
|
|
66
66
|
Prism.languages.insertBefore('ruby', 'number', {
|
67
|
-
'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|
|
67
|
+
'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
|
68
68
|
'constant': /\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/
|
69
69
|
});
|
70
70
|
|
@@ -23,7 +23,12 @@ Prism.languages.scss = Prism.languages.extend('css', {
|
|
23
23
|
// Initial look-ahead is used to prevent matching of blank selectors
|
24
24
|
pattern: /(?=\S)[^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m,
|
25
25
|
inside: {
|
26
|
-
'
|
26
|
+
'parent': {
|
27
|
+
pattern: /&/,
|
28
|
+
alias: 'important'
|
29
|
+
},
|
30
|
+
'placeholder': /%[-_\w]+/,
|
31
|
+
'variable': /\$[-_\w]+|#\{\$[-_\w]+\}/
|
27
32
|
}
|
28
33
|
}
|
29
34
|
});
|
@@ -38,7 +43,14 @@ Prism.languages.insertBefore('scss', 'atrule', {
|
|
38
43
|
]
|
39
44
|
});
|
40
45
|
|
41
|
-
Prism.languages.
|
46
|
+
Prism.languages.scss.property = {
|
47
|
+
pattern: /(?:[\w-]|\$[-_\w]+|#\{\$[-_\w]+\})+(?=\s*:)/i,
|
48
|
+
inside: {
|
49
|
+
'variable': /\$[-_\w]+|#\{\$[-_\w]+\}/
|
50
|
+
}
|
51
|
+
};
|
52
|
+
|
53
|
+
Prism.languages.insertBefore('scss', 'important', {
|
42
54
|
// var and interpolated vars
|
43
55
|
'variable': /\$[-_\w]+|#\{\$[-_\w]+\}/
|
44
56
|
});
|
@@ -48,7 +60,10 @@ Prism.languages.insertBefore('scss', 'function', {
|
|
48
60
|
pattern: /%[-_\w]+/,
|
49
61
|
alias: 'selector'
|
50
62
|
},
|
51
|
-
'statement':
|
63
|
+
'statement': {
|
64
|
+
pattern: /\B!(?:default|optional)\b/i,
|
65
|
+
alias: 'keyword'
|
66
|
+
},
|
52
67
|
'boolean': /\b(?:true|false)\b/,
|
53
68
|
'null': /\bnull\b/,
|
54
69
|
'operator': {
|
@@ -5,7 +5,7 @@ if (typeof self === 'undefined' || !self.Prism || !self.document) {
|
|
5
5
|
}
|
6
6
|
|
7
7
|
// The languages map is built automatically with gulp
|
8
|
-
var Languages = /*languages_placeholder[*/{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","asciidoc":"AsciiDoc","aspnet":"ASP.NET (C#)","autoit":"AutoIt","autohotkey":"AutoHotkey","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","css-extras":"CSS Extras","fsharp":"F#","glsl":"GLSL","http":"HTTP","inform7":"Inform 7","json":"JSON","latex":"LaTeX","lolcode":"LOLCODE","matlab":"MATLAB","mel":"MEL","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","parigp":"PARI/GP","php":"PHP","php-extras":"PHP Extras","powershell":"PowerShell","protobuf":"Protocol Buffers","jsx":"React JSX","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vhdl":"VHDL","vim":"vim","wiki":"Wiki markup","yaml":"YAML"}/*]*/;
|
8
|
+
var Languages = /*languages_placeholder[*/{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","asciidoc":"AsciiDoc","aspnet":"ASP.NET (C#)","autoit":"AutoIt","autohotkey":"AutoHotkey","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","css-extras":"CSS Extras","fsharp":"F#","glsl":"GLSL","graphql":"GraphQL","http":"HTTP","inform7":"Inform 7","json":"JSON","latex":"LaTeX","livescript":"LiveScript","lolcode":"LOLCODE","matlab":"MATLAB","mel":"MEL","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","parigp":"PARI/GP","php":"PHP","php-extras":"PHP Extras","powershell":"PowerShell","properties":".properties","protobuf":"Protocol Buffers","jsx":"React JSX","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vhdl":"VHDL","vim":"vim","wiki":"Wiki markup","xojo":"Xojo (REALbasic)","yaml":"YAML"}/*]*/;
|
9
9
|
Prism.hooks.add('before-highlight', function(env) {
|
10
10
|
var pre = env.element.parentNode;
|
11
11
|
if (!pre || !/pre/i.test(pre.nodeName)) {
|
@@ -236,6 +236,9 @@
|
|
236
236
|
'mark': Prism.util.clone(Prism.languages.textile['phrase'].inside['mark'])
|
237
237
|
};
|
238
238
|
|
239
|
+
// Only allow alpha-numeric HTML tags, not XML tags
|
240
|
+
Prism.languages.textile.tag.pattern = /<\/?(?!\d)[a-z0-9]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i;
|
241
|
+
|
239
242
|
// Allow some nesting
|
240
243
|
Prism.languages.textile['phrase'].inside['inline'].inside['bold'].inside = nestedPatterns;
|
241
244
|
Prism.languages.textile['phrase'].inside['inline'].inside['italic'].inside = nestedPatterns;
|
@@ -8,8 +8,6 @@ if (
|
|
8
8
|
}
|
9
9
|
|
10
10
|
if (Prism.languages.css) {
|
11
|
-
Prism.languages.css.atrule.inside['atrule-id'] = /^@[\w-]+/;
|
12
|
-
|
13
11
|
// check whether the selector is an advanced pattern before extending it
|
14
12
|
if (Prism.languages.css.selector.pattern)
|
15
13
|
{
|
@@ -57,60 +55,65 @@ var language;
|
|
57
55
|
Prism.hooks.add('wrap', function(env) {
|
58
56
|
if ((env.type == 'tag-id'
|
59
57
|
|| (env.type == 'property' && env.content.indexOf('-') != 0)
|
60
|
-
|| (env.type == '
|
58
|
+
|| (env.type == 'rule'&& env.content.indexOf('@-') != 0)
|
61
59
|
|| (env.type == 'pseudo-class'&& env.content.indexOf(':-') != 0)
|
62
60
|
|| (env.type == 'pseudo-element'&& env.content.indexOf('::-') != 0)
|
63
|
-
|
64
|
-
|
61
|
+
|| (env.type == 'attr-name' && env.content.indexOf('data-') != 0)
|
62
|
+
) && env.content.indexOf('<') === -1
|
65
63
|
) {
|
66
|
-
|
64
|
+
if (env.language == 'css'
|
65
|
+
|| env.language == 'scss'
|
66
|
+
|| env.language == 'markup'
|
67
|
+
) {
|
68
|
+
var searchURL = 'w/index.php?fulltext&search=';
|
67
69
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
}
|
81
|
-
else if (env.type == 'pseudo-class') {
|
82
|
-
href += 'selectors/pseudo-classes/';
|
83
|
-
}
|
84
|
-
else if (env.type == 'pseudo-element') {
|
85
|
-
href += 'selectors/pseudo-elements/';
|
86
|
-
}
|
87
|
-
}
|
88
|
-
else if (env.language == 'markup') {
|
89
|
-
if (env.type == 'tag-id') {
|
90
|
-
// Check language
|
91
|
-
language = getLanguage(env.content) || language;
|
92
|
-
|
93
|
-
if (language) {
|
94
|
-
href += 'wiki/' + language + '/elements/';
|
70
|
+
env.tag = 'a';
|
71
|
+
|
72
|
+
var href = 'http://docs.webplatform.org/';
|
73
|
+
|
74
|
+
if (env.language == 'css' || env.language == 'scss') {
|
75
|
+
href += 'wiki/css/';
|
76
|
+
|
77
|
+
if (env.type == 'property') {
|
78
|
+
href += 'properties/';
|
79
|
+
}
|
80
|
+
else if (env.type == 'rule') {
|
81
|
+
href += 'atrules/';
|
95
82
|
}
|
96
|
-
else {
|
97
|
-
href +=
|
83
|
+
else if (env.type == 'pseudo-class') {
|
84
|
+
href += 'selectors/pseudo-classes/';
|
85
|
+
}
|
86
|
+
else if (env.type == 'pseudo-element') {
|
87
|
+
href += 'selectors/pseudo-elements/';
|
98
88
|
}
|
99
89
|
}
|
100
|
-
else if (env.
|
101
|
-
if (
|
102
|
-
|
90
|
+
else if (env.language == 'markup') {
|
91
|
+
if (env.type == 'tag-id') {
|
92
|
+
// Check language
|
93
|
+
language = getLanguage(env.content) || language;
|
94
|
+
|
95
|
+
if (language) {
|
96
|
+
href += 'wiki/' + language + '/elements/';
|
97
|
+
}
|
98
|
+
else {
|
99
|
+
href += searchURL;
|
100
|
+
}
|
103
101
|
}
|
104
|
-
else {
|
105
|
-
|
102
|
+
else if (env.type == 'attr-name') {
|
103
|
+
if (language) {
|
104
|
+
href += 'wiki/' + language + '/attributes/';
|
105
|
+
}
|
106
|
+
else {
|
107
|
+
href += searchURL;
|
108
|
+
}
|
106
109
|
}
|
107
110
|
}
|
111
|
+
|
112
|
+
href += env.content;
|
113
|
+
|
114
|
+
env.attributes.href = href;
|
115
|
+
env.attributes.target = '_blank';
|
108
116
|
}
|
109
|
-
|
110
|
-
href += env.content;
|
111
|
-
|
112
|
-
env.attributes.href = href;
|
113
|
-
env.attributes.target = '_blank';
|
114
117
|
}
|
115
118
|
});
|
116
119
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Prism.languages.xojo = {
|
2
|
+
'comment': {
|
3
|
+
pattern: /(?:'|\/\/|Rem\b).+/i,
|
4
|
+
inside: {
|
5
|
+
'keyword': /^Rem/i
|
6
|
+
}
|
7
|
+
},
|
8
|
+
'string': {
|
9
|
+
pattern: /"(?:""|[^"])*"/,
|
10
|
+
greedy: true
|
11
|
+
},
|
12
|
+
'number': [
|
13
|
+
/(?:\b|\B[.-])(?:\d+\.?\d*)(?:E[+-]?\d+)?/i,
|
14
|
+
/&[bchou][a-z\d]+/i
|
15
|
+
],
|
16
|
+
'symbol': /#(?:If|Else|ElseIf|Endif|Pragma)\b/i,
|
17
|
+
'keyword': /\b(?:AddHandler|App|Array|As(?:signs)?|By(?:Ref|Val)|Break|Call|Case|Catch|Const|Continue|CurrentMethodName|Declare|Dim|Do(?:wnTo)?|Each|Else(?:If)?|End|Exit|Extends|False|Finally|For|Global|If|In|Lib|Loop|Me|Next|Nil|Optional|ParamArray|Raise(?:Event)?|ReDim|Rem|RemoveHandler|Return|Select|Self|Soft|Static|Step|Super|Then|To|True|Try|Ubound|Until|Using|Wend|While)\b/i,
|
18
|
+
'operator': /<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i,
|
19
|
+
'punctuation': /[.,;:()]/
|
20
|
+
};
|
@@ -282,7 +282,8 @@ var _ = _self.Prism = {
|
|
282
282
|
|
283
283
|
if (greedy && !pattern.pattern.global) {
|
284
284
|
// Without the global flag, lastIndex won't work
|
285
|
-
|
285
|
+
var flags = pattern.pattern.toString().match(/[imuy]*$/)[0];
|
286
|
+
pattern.pattern = RegExp(pattern.pattern.source, flags + "g");
|
286
287
|
}
|
287
288
|
|
288
289
|
pattern = pattern.pattern || pattern;
|
@@ -450,7 +451,7 @@ Token.stringify = function(o, language, parent) {
|
|
450
451
|
attributes += (attributes ? ' ' : '') + name + '="' + (env.attributes[name] || '') + '"';
|
451
452
|
}
|
452
453
|
|
453
|
-
return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + '</' + env.tag + '>';
|
454
|
+
return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + '</' + env.tag + '>';
|
454
455
|
|
455
456
|
};
|
456
457
|
|
@@ -483,7 +484,11 @@ if (script) {
|
|
483
484
|
|
484
485
|
if (document.addEventListener && !script.hasAttribute('data-manual')) {
|
485
486
|
if(document.readyState !== "loading") {
|
486
|
-
|
487
|
+
if (window.requestAnimationFrame) {
|
488
|
+
window.requestAnimationFrame(_.highlightAll);
|
489
|
+
} else {
|
490
|
+
window.setTimeout(_.highlightAll, 16);
|
491
|
+
}
|
487
492
|
}
|
488
493
|
else {
|
489
494
|
document.addEventListener('DOMContentLoaded', _.highlightAll);
|
@@ -150,3 +150,23 @@ pre > code.highlight {
|
|
150
150
|
outline: 0.4em solid #c94922;
|
151
151
|
outline-offset: .4em;
|
152
152
|
}
|
153
|
+
|
154
|
+
/* overrides color-values for the Line Numbers plugin
|
155
|
+
* http://prismjs.com/plugins/line-numbers/
|
156
|
+
*/
|
157
|
+
.line-numbers .line-numbers-rows {
|
158
|
+
border-right-color: #dfe2f1;
|
159
|
+
}
|
160
|
+
|
161
|
+
.line-numbers-rows > span:before {
|
162
|
+
color: #979db4;
|
163
|
+
}
|
164
|
+
|
165
|
+
/* overrides color-values for the Line Highlight plugin
|
166
|
+
* http://prismjs.com/plugins/line-highlight/
|
167
|
+
*/
|
168
|
+
.line-highlight {
|
169
|
+
background: rgba(107, 115, 148, 0.2);
|
170
|
+
background: -webkit-linear-gradient(left, rgba(107, 115, 148, 0.2) 70%, rgba(107, 115, 148, 0));
|
171
|
+
background: linear-gradient(to right, rgba(107, 115, 148, 0.2) 70%, rgba(107, 115, 148, 0));
|
172
|
+
}
|