Skip to content

Commit 385788c

Browse files
committed
Update Prism.js
1 parent 6783d08 commit 385788c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

assets/javascripts/vendor/prism.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ var _ = _self.Prism = {
6060
return clone;
6161

6262
case 'Array':
63-
// Check for existence for IE8
64-
return o.map && o.map(function(v) { return _.util.clone(v); });
63+
return o.map(function(v) { return _.util.clone(v); });
6564
}
6665

6766
return o;
@@ -507,7 +506,7 @@ Token.stringify = function(o, language, parent) {
507506
// if (script) {
508507
// _.filename = script.src;
509508

510-
// if (document.addEventListener && !_.manual && !script.hasAttribute('data-manual')) {
509+
// if (!_.manual && !script.hasAttribute('data-manual')) {
511510
// if(document.readyState !== "loading") {
512511
// if (window.requestAnimationFrame) {
513512
// window.requestAnimationFrame(_.highlightAll);
@@ -638,7 +637,7 @@ if (Prism.languages.markup) {
638637
Prism.languages.clike = {
639638
'comment': [
640639
{
641-
pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
640+
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
642641
lookbehind: true
643642
},
644643
{
@@ -715,7 +714,7 @@ if (Prism.languages.markup) {
715714
Prism.languages.js = Prism.languages.javascript;
716715

717716
Prism.languages.c = Prism.languages.extend('clike', {
718-
'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
717+
'keyword': /\b(_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/,
719718
'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
720719
'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i
721720
});
@@ -735,14 +734,14 @@ Prism.languages.insertBefore('c', 'string', {
735734
},
736735
// highlight macro directives as keywords
737736
'directive': {
738-
pattern: /(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,
737+
pattern: /(#\s*)\b(define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,
739738
lookbehind: true,
740739
alias: 'keyword'
741740
}
742741
}
743742
},
744743
// highlight predefined macros as constants
745-
'constant': /\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/
744+
'constant': /\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/
746745
});
747746

748747
delete Prism.languages.c['class-name'];

0 commit comments

Comments
 (0)