Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

highlight.js

Package Overview
Dependencies
Maintainers
6
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

highlight.js - npm Package Compare versions

Comparing version 10.5.0 to 10.6.0

2

lib/languages/abnf.js

@@ -89,3 +89,3 @@ /**

illegal: regexes.unexpectedChars,
keywords: keywords.join(" "),
keywords: keywords,
contains: [

@@ -92,0 +92,0 @@ ruleDeclarationMode,

@@ -80,3 +80,3 @@ /**

end: /"/,
keywords: HTTP_VERBS.join(" "),
keywords: HTTP_VERBS,
illegal: /\n/,

@@ -83,0 +83,0 @@ relevance: 5,

@@ -35,9 +35,9 @@ /**

/*
Language: C-like foundation grammar for C/C++ grammars
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
Contributors: Evgeny Stepanischev <imbolk@gmail.com>, Zaven Muradyan <megalivoithos@gmail.com>, Roel Deckers <admin@codingcat.nl>, Sam Wu <samsam2310@gmail.com>, Jordi Petit <jordi.petit@gmail.com>, Pieter Vantorre <pietervantorre@gmail.com>, Google Inc. (David Benjamin) <davidben@google.com>
Language: C++
Category: common, system
Website: https://isocpp.org
*/
/** @type LanguageFn */
function cLike(hljs) {
function cPlusPlus(hljs) {
// added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does

@@ -264,6 +264,5 @@ // not include such support nor can we be sure all the grammars depending

return {
name: 'C++',
aliases: [
'c',
'cc',
'h',
'c++',

@@ -277,5 +276,2 @@ 'h++',

keywords: CPP_KEYWORDS,
// the base c-like language will NEVER be auto-detected, rather the
// derivitives: c, c++, arduino turn auto-detect back on for themselves
disableAutodetect: true,
illegal: '</',

@@ -322,18 +318,2 @@ contains: [].concat(

/*
Language: C++
Category: common, system
Website: https://isocpp.org
*/
/** @type LanguageFn */
function cPlusPlus(hljs) {
const lang = cLike(hljs);
// return auto-detection back on
lang.disableAutodetect = false;
lang.name = 'C++';
lang.aliases = ['cc', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx'];
return lang;
}
/*
Language: Arduino

@@ -340,0 +320,0 @@ Author: Stefania Mellai <s.mellai@arduino.cc>

@@ -142,5 +142,5 @@ /*

const KEYWORDS = {
keyword: NORMAL_KEYWORDS.join(' '),
built_in: BUILT_IN_KEYWORDS.join(' '),
literal: LITERAL_KEYWORDS.join(' ')
keyword: NORMAL_KEYWORDS,
built_in: BUILT_IN_KEYWORDS,
literal: LITERAL_KEYWORDS
};

@@ -147,0 +147,0 @@

@@ -35,9 +35,9 @@ /**

/*
Language: C-like foundation grammar for C/C++ grammars
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
Contributors: Evgeny Stepanischev <imbolk@gmail.com>, Zaven Muradyan <megalivoithos@gmail.com>, Roel Deckers <admin@codingcat.nl>, Sam Wu <samsam2310@gmail.com>, Jordi Petit <jordi.petit@gmail.com>, Pieter Vantorre <pietervantorre@gmail.com>, Google Inc. (David Benjamin) <davidben@google.com>
Language: C++
Category: common, system
Website: https://isocpp.org
*/
/** @type LanguageFn */
function cLike(hljs) {
function cPlusPlus(hljs) {
// added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does

@@ -264,6 +264,5 @@ // not include such support nor can we be sure all the grammars depending

return {
name: 'C++',
aliases: [
'c',
'cc',
'h',
'c++',

@@ -277,5 +276,2 @@ 'h++',

keywords: CPP_KEYWORDS,
// the base c-like language will NEVER be auto-detected, rather the
// derivitives: c, c++, arduino turn auto-detect back on for themselves
disableAutodetect: true,
illegal: '</',

@@ -321,2 +317,39 @@ contains: [].concat(

/*
Language: C-like (deprecated, use C and C++ instead)
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
Contributors: Evgeny Stepanischev <imbolk@gmail.com>, Zaven Muradyan <megalivoithos@gmail.com>, Roel Deckers <admin@codingcat.nl>, Sam Wu <samsam2310@gmail.com>, Jordi Petit <jordi.petit@gmail.com>, Pieter Vantorre <pietervantorre@gmail.com>, Google Inc. (David Benjamin) <davidben@google.com>
*/
/** @type LanguageFn */
function cLike(hljs) {
const lang = cPlusPlus(hljs);
const C_ALIASES = [
"c",
"h"
];
const CPP_ALIASES = [
'cc',
'c++',
'h++',
'hpp',
'hh',
'hxx',
'cxx'
];
lang.disableAutodetect = true;
lang.aliases = [];
// support users only loading c-like (legacy)
if (!hljs.getLanguage("c")) lang.aliases.push(...C_ALIASES);
if (!hljs.getLanguage("cpp")) lang.aliases.push(...CPP_ALIASES);
// if c and cpp are loaded after then they will reclaim these
// aliases for themselves
return lang;
}
module.exports = cLike;

@@ -35,9 +35,9 @@ /**

/*
Language: C-like foundation grammar for C/C++ grammars
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
Contributors: Evgeny Stepanischev <imbolk@gmail.com>, Zaven Muradyan <megalivoithos@gmail.com>, Roel Deckers <admin@codingcat.nl>, Sam Wu <samsam2310@gmail.com>, Jordi Petit <jordi.petit@gmail.com>, Pieter Vantorre <pietervantorre@gmail.com>, Google Inc. (David Benjamin) <davidben@google.com>
Language: C
Category: common, system
Website: https://en.wikipedia.org/wiki/C_(programming_language)
*/
/** @type LanguageFn */
function cLike(hljs) {
function c(hljs) {
// added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does

@@ -264,16 +264,10 @@ // not include such support nor can we be sure all the grammars depending

return {
name: "C",
aliases: [
'c',
'cc',
'h',
'c++',
'h++',
'hpp',
'hh',
'hxx',
'cxx'
'h'
],
keywords: CPP_KEYWORDS,
// the base c-like language will NEVER be auto-detected, rather the
// derivitives: c, c++, arduino turn auto-detect back on for themselves
// Until differentiations are added between `c` and `cpp`, `c` will
// not be auto-detected to avoid auto-detect conflicts between C and C++
disableAutodetect: true,

@@ -320,23 +314,2 @@ illegal: '</',

/*
Language: C
Category: common, system
Website: https://en.wikipedia.org/wiki/C_(programming_language)
*/
/** @type LanguageFn */
function c(hljs) {
const lang = cLike(hljs);
// Until C is actually different than C++ there is no reason to auto-detect C
// as it's own language since it would just fail auto-detect testing or
// simply match with C++.
//
// See further comments in c-like.js.
// lang.disableAutodetect = false;
lang.name = 'C';
lang.aliases = ['c', 'h'];
return lang;
}
module.exports = c;

@@ -14,10 +14,12 @@ /*

name: 'Clojure REPL',
contains: [{
className: 'meta',
begin: /^([\w.-]+|\s*#_)?=>/,
starts: {
end: /$/,
subLanguage: 'clojure'
contains: [
{
className: 'meta',
begin: /^([\w.-]+|\s*#_)?=>/,
starts: {
end: /$/,
subLanguage: 'clojure'
}
}
}]
]
};

@@ -24,0 +26,0 @@ }

@@ -11,6 +11,6 @@ /*

function clojure(hljs) {
var SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\'';
var SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*';
var globals = 'def defonce defprotocol defstruct defmulti defmethod defn- defn defmacro deftype defrecord';
var keywords = {
const SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\'';
const SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*';
const globals = 'def defonce defprotocol defstruct defmulti defmethod defn- defn defmacro deftype defrecord';
const keywords = {
$pattern: SYMBOL_RE,

@@ -49,14 +49,17 @@ 'builtin-name':

var SIMPLE_NUMBER_RE = '[-+]?\\d+(\\.\\d+)?';
const SIMPLE_NUMBER_RE = '[-+]?\\d+(\\.\\d+)?';
var SYMBOL = {
const SYMBOL = {
begin: SYMBOL_RE,
relevance: 0
};
var NUMBER = {
className: 'number', begin: SIMPLE_NUMBER_RE,
const NUMBER = {
className: 'number',
begin: SIMPLE_NUMBER_RE,
relevance: 0
};
var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null});
var COMMENT = hljs.COMMENT(
const STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {
illegal: null
});
const COMMENT = hljs.COMMENT(
';',

@@ -68,26 +71,28 @@ '$',

);
var LITERAL = {
const LITERAL = {
className: 'literal',
begin: /\b(true|false|nil)\b/
};
var COLLECTION = {
begin: '[\\[\\{]', end: '[\\]\\}]'
const COLLECTION = {
begin: '[\\[\\{]',
end: '[\\]\\}]'
};
var HINT = {
const HINT = {
className: 'comment',
begin: '\\^' + SYMBOL_RE
};
var HINT_COL = hljs.COMMENT('\\^\\{', '\\}');
var KEY = {
const HINT_COL = hljs.COMMENT('\\^\\{', '\\}');
const KEY = {
className: 'symbol',
begin: '[:]{1,2}' + SYMBOL_RE
};
var LIST = {
begin: '\\(', end: '\\)'
const LIST = {
begin: '\\(',
end: '\\)'
};
var BODY = {
const BODY = {
endsWithParent: true,
relevance: 0
};
var NAME = {
const NAME = {
keywords: keywords,

@@ -99,5 +104,16 @@ className: 'name',

};
var DEFAULT_CONTAINS = [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL, SYMBOL];
const DEFAULT_CONTAINS = [
LIST,
STRING,
HINT,
HINT_COL,
COMMENT,
KEY,
COLLECTION,
NUMBER,
LITERAL,
SYMBOL
];
var GLOBAL = {
const GLOBAL = {
beginKeywords: globals,

@@ -114,16 +130,31 @@ lexemes: SYMBOL_RE,

endsParent: true
},
}
].concat(DEFAULT_CONTAINS)
};
LIST.contains = [hljs.COMMENT('comment', ''), GLOBAL, NAME, BODY];
LIST.contains = [
hljs.COMMENT('comment', ''),
GLOBAL,
NAME,
BODY
];
BODY.contains = DEFAULT_CONTAINS;
COLLECTION.contains = DEFAULT_CONTAINS;
HINT_COL.contains = [COLLECTION];
HINT_COL.contains = [ COLLECTION ];
return {
name: 'Clojure',
aliases: ['clj'],
aliases: [ 'clj' ],
illegal: /\S/,
contains: [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL]
contains: [
LIST,
STRING,
HINT,
HINT_COL,
COMMENT,
KEY,
COLLECTION,
NUMBER,
LITERAL
]
};

@@ -130,0 +161,0 @@ }

@@ -182,5 +182,5 @@ const KEYWORDS = [

const KEYWORDS$1 = {
keyword: KEYWORDS.concat(COFFEE_KEYWORDS).filter(excluding(NOT_VALID_KEYWORDS)).join(" "),
literal: LITERALS.concat(COFFEE_LITERALS).join(" "),
built_in: BUILT_INS.concat(COFFEE_BUILT_INS).join(" ")
keyword: KEYWORDS.concat(COFFEE_KEYWORDS).filter(excluding(NOT_VALID_KEYWORDS)),
literal: LITERALS.concat(COFFEE_LITERALS),
built_in: BUILT_INS.concat(COFFEE_BUILT_INS)
};

@@ -187,0 +187,0 @@ const JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';

@@ -35,9 +35,9 @@ /**

/*
Language: C-like foundation grammar for C/C++ grammars
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
Contributors: Evgeny Stepanischev <imbolk@gmail.com>, Zaven Muradyan <megalivoithos@gmail.com>, Roel Deckers <admin@codingcat.nl>, Sam Wu <samsam2310@gmail.com>, Jordi Petit <jordi.petit@gmail.com>, Pieter Vantorre <pietervantorre@gmail.com>, Google Inc. (David Benjamin) <davidben@google.com>
Language: C++
Category: common, system
Website: https://isocpp.org
*/
/** @type LanguageFn */
function cLike(hljs) {
function cpp(hljs) {
// added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does

@@ -264,6 +264,5 @@ // not include such support nor can we be sure all the grammars depending

return {
name: 'C++',
aliases: [
'c',
'cc',
'h',
'c++',

@@ -277,5 +276,2 @@ 'h++',

keywords: CPP_KEYWORDS,
// the base c-like language will NEVER be auto-detected, rather the
// derivitives: c, c++, arduino turn auto-detect back on for themselves
disableAutodetect: true,
illegal: '</',

@@ -321,18 +317,2 @@ contains: [].concat(

/*
Language: C++
Category: common, system
Website: https://isocpp.org
*/
/** @type LanguageFn */
function cpp(hljs) {
const lang = cLike(hljs);
// return auto-detection back on
lang.disableAutodetect = false;
lang.name = 'C++';
lang.aliases = ['cc', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx'];
return lang;
}
module.exports = cpp;

@@ -151,5 +151,5 @@ /*

var KEYWORDS = {
keyword: NORMAL_KEYWORDS.concat(CONTEXTUAL_KEYWORDS).join(' '),
built_in: BUILT_IN_KEYWORDS.join(' '),
literal: LITERAL_KEYWORDS.join(' ')
keyword: NORMAL_KEYWORDS.concat(CONTEXTUAL_KEYWORDS),
built_in: BUILT_IN_KEYWORDS,
literal: LITERAL_KEYWORDS
};

@@ -156,0 +156,0 @@ var TITLE_MODE = hljs.inherit(hljs.TITLE_MODE, {begin: '[a-zA-Z](\\.?\\w)*'});

@@ -0,1 +1,461 @@

const MODES = (hljs) => {
return {
IMPORTANT: {
className: 'meta',
begin: '!important'
},
HEXCOLOR: {
className: 'number',
begin: '#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})'
},
ATTRIBUTE_SELECTOR_MODE: {
className: 'selector-attr',
begin: /\[/,
end: /\]/,
illegal: '$',
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
}
};
};
const TAGS = [
'a',
'abbr',
'address',
'article',
'aside',
'audio',
'b',
'blockquote',
'body',
'button',
'canvas',
'caption',
'cite',
'code',
'dd',
'del',
'details',
'dfn',
'div',
'dl',
'dt',
'em',
'fieldset',
'figcaption',
'figure',
'footer',
'form',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'header',
'hgroup',
'html',
'i',
'iframe',
'img',
'input',
'ins',
'kbd',
'label',
'legend',
'li',
'main',
'mark',
'menu',
'nav',
'object',
'ol',
'p',
'q',
'quote',
'samp',
'section',
'span',
'strong',
'summary',
'sup',
'table',
'tbody',
'td',
'textarea',
'tfoot',
'th',
'thead',
'time',
'tr',
'ul',
'var',
'video'
];
const MEDIA_FEATURES = [
'any-hover',
'any-pointer',
'aspect-ratio',
'color',
'color-gamut',
'color-index',
'device-aspect-ratio',
'device-height',
'device-width',
'display-mode',
'forced-colors',
'grid',
'height',
'hover',
'inverted-colors',
'monochrome',
'orientation',
'overflow-block',
'overflow-inline',
'pointer',
'prefers-color-scheme',
'prefers-contrast',
'prefers-reduced-motion',
'prefers-reduced-transparency',
'resolution',
'scan',
'scripting',
'update',
'width',
// TODO: find a better solution?
'min-width',
'max-width',
'min-height',
'max-height'
];
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
const PSEUDO_CLASSES = [
'active',
'any-link',
'blank',
'checked',
'current',
'default',
'defined',
'dir', // dir()
'disabled',
'drop',
'empty',
'enabled',
'first',
'first-child',
'first-of-type',
'fullscreen',
'future',
'focus',
'focus-visible',
'focus-within',
'has', // has()
'host', // host or host()
'host-context', // host-context()
'hover',
'indeterminate',
'in-range',
'invalid',
'is', // is()
'lang', // lang()
'last-child',
'last-of-type',
'left',
'link',
'local-link',
'not', // not()
'nth-child', // nth-child()
'nth-col', // nth-col()
'nth-last-child', // nth-last-child()
'nth-last-col', // nth-last-col()
'nth-last-of-type', //nth-last-of-type()
'nth-of-type', //nth-of-type()
'only-child',
'only-of-type',
'optional',
'out-of-range',
'past',
'placeholder-shown',
'read-only',
'read-write',
'required',
'right',
'root',
'scope',
'target',
'target-within',
'user-invalid',
'valid',
'visited',
'where' // where()
];
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements
const PSEUDO_ELEMENTS = [
'after',
'backdrop',
'before',
'cue',
'cue-region',
'first-letter',
'first-line',
'grammar-error',
'marker',
'part',
'placeholder',
'selection',
'slotted',
'spelling-error'
];
const ATTRIBUTES = [
'align-content',
'align-items',
'align-self',
'animation',
'animation-delay',
'animation-direction',
'animation-duration',
'animation-fill-mode',
'animation-iteration-count',
'animation-name',
'animation-play-state',
'animation-timing-function',
'auto',
'backface-visibility',
'background',
'background-attachment',
'background-clip',
'background-color',
'background-image',
'background-origin',
'background-position',
'background-repeat',
'background-size',
'border',
'border-bottom',
'border-bottom-color',
'border-bottom-left-radius',
'border-bottom-right-radius',
'border-bottom-style',
'border-bottom-width',
'border-collapse',
'border-color',
'border-image',
'border-image-outset',
'border-image-repeat',
'border-image-slice',
'border-image-source',
'border-image-width',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-radius',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-style',
'border-top',
'border-top-color',
'border-top-left-radius',
'border-top-right-radius',
'border-top-style',
'border-top-width',
'border-width',
'bottom',
'box-decoration-break',
'box-shadow',
'box-sizing',
'break-after',
'break-before',
'break-inside',
'caption-side',
'clear',
'clip',
'clip-path',
'color',
'column-count',
'column-fill',
'column-gap',
'column-rule',
'column-rule-color',
'column-rule-style',
'column-rule-width',
'column-span',
'column-width',
'columns',
'content',
'counter-increment',
'counter-reset',
'cursor',
'direction',
'display',
'empty-cells',
'filter',
'flex',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-grow',
'flex-shrink',
'flex-wrap',
'float',
'font',
'font-display',
'font-family',
'font-feature-settings',
'font-kerning',
'font-language-override',
'font-size',
'font-size-adjust',
'font-stretch',
'font-style',
'font-variant',
'font-variant-ligatures',
'font-variation-settings',
'font-weight',
'height',
'hyphens',
'icon',
'image-orientation',
'image-rendering',
'image-resolution',
'ime-mode',
'inherit',
'initial',
'justify-content',
'left',
'letter-spacing',
'line-height',
'list-style',
'list-style-image',
'list-style-position',
'list-style-type',
'margin',
'margin-bottom',
'margin-left',
'margin-right',
'margin-top',
'marks',
'mask',
'max-height',
'max-width',
'min-height',
'min-width',
'nav-down',
'nav-index',
'nav-left',
'nav-right',
'nav-up',
'none',
'normal',
'object-fit',
'object-position',
'opacity',
'order',
'orphans',
'outline',
'outline-color',
'outline-offset',
'outline-style',
'outline-width',
'overflow',
'overflow-wrap',
'overflow-x',
'overflow-y',
'padding',
'padding-bottom',
'padding-left',
'padding-right',
'padding-top',
'page-break-after',
'page-break-before',
'page-break-inside',
'perspective',
'perspective-origin',
'pointer-events',
'position',
'quotes',
'resize',
'right',
'src', // @font-face
'tab-size',
'table-layout',
'text-align',
'text-align-last',
'text-decoration',
'text-decoration-color',
'text-decoration-line',
'text-decoration-style',
'text-indent',
'text-overflow',
'text-rendering',
'text-shadow',
'text-transform',
'text-underline-position',
'top',
'transform',
'transform-origin',
'transform-style',
'transition',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'unicode-bidi',
'vertical-align',
'visibility',
'white-space',
'widows',
'width',
'word-break',
'word-spacing',
'word-wrap',
'z-index'
// reverse makes sure longer attributes `font-weight` are matched fully
// instead of getting false positives on say `font`
].reverse();
/**
* @param {string} value
* @returns {RegExp}
* */
/**
* @param {RegExp | string } re
* @returns {string}
*/
function source(re) {
if (!re) return null;
if (typeof re === "string") return re;
return re.source;
}
/**
* @param {RegExp | string } re
* @returns {string}
*/
function lookahead(re) {
return concat('(?=', re, ')');
}
/**
* @param {...(RegExp | string) } args
* @returns {string}
*/
function concat(...args) {
const joined = args.map((x) => source(x)).join("");
return joined;
}
/*

@@ -9,49 +469,17 @@ Language: CSS

function css(hljs) {
var FUNCTION_LIKE = {
begin: /[\w-]+\(/, returnBegin: true,
contains: [
{
className: 'built_in',
begin: /[\w-]+/
},
{
begin: /\(/, end: /\)/,
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.CSS_NUMBER_MODE,
]
}
]
const modes = MODES(hljs);
const FUNCTION_DISPATCH = {
className: "built_in",
begin: /[\w-]+(?=\()/
};
var ATTRIBUTE = {
className: 'attribute',
begin: /\S/, end: ':', excludeEnd: true,
starts: {
endsWithParent: true, excludeEnd: true,
contains: [
FUNCTION_LIKE,
hljs.CSS_NUMBER_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'number', begin: '#[0-9A-Fa-f]+'
},
{
className: 'meta', begin: '!important'
}
]
}
const VENDOR_PREFIX = {
begin: /-(webkit|moz|ms|o)-(?=[a-z])/
};
var AT_IDENTIFIER = '@[a-z-]+'; // @font-face
var AT_MODIFIERS = "and or not only";
var AT_PROPERTY_RE = /@-?\w[\w]*(-\w+)*/; // @-webkit-keyframes
var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
var RULE = {
begin: /([*]\s?)?(?:[A-Z_.\-\\]+|--[a-zA-Z0-9_-]+)\s*(\/\*\*\/)?:/, returnBegin: true, end: ';', endsWithParent: true,
contains: [
ATTRIBUTE
]
};
const AT_MODIFIERS = "and or not only";
const AT_PROPERTY_RE = /@-?\w[\w]*(-\w+)*/; // @-webkit-keyframes
const IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
const STRINGS = [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
];

@@ -62,38 +490,86 @@ return {

illegal: /[=|'\$]/,
keywords: {
keyframePosition: "from to"
},
classNameAliases: {
// for visual continuity with `tag {}` and because we
// don't have a great class for this?
keyframePosition: "selector-tag"
},
contains: [
hljs.C_BLOCK_COMMENT_MODE,
VENDOR_PREFIX,
// to recognize keyframe 40% etc which are outside the scope of our
// attribute value mode
hljs.CSS_NUMBER_MODE,
{
className: 'selector-id', begin: /#[A-Za-z0-9_-]+/
className: 'selector-id',
begin: /#[A-Za-z0-9_-]+/,
relevance: 0
},
{
className: 'selector-class', begin: '\\.' + IDENT_RE
className: 'selector-class',
begin: '\\.' + IDENT_RE,
relevance: 0
},
modes.ATTRIBUTE_SELECTOR_MODE,
{
className: 'selector-attr',
begin: /\[/, end: /\]/,
illegal: '$',
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
className: 'selector-pseudo',
variants: [
{
begin: ':(' + PSEUDO_CLASSES.join('|') + ')'
},
{
begin: '::(' + PSEUDO_ELEMENTS.join('|') + ')'
}
]
},
// we may actually need this (12/2020)
// { // pseudo-selector params
// begin: /\(/,
// end: /\)/,
// contains: [ hljs.CSS_NUMBER_MODE ]
// },
{
className: 'selector-pseudo',
begin: /:(:)?[a-zA-Z0-9_+()"'.-]+/
className: 'attribute',
begin: '\\b(' + ATTRIBUTES.join('|') + ')\\b'
},
// matching these here allows us to treat them more like regular CSS
// rules so everything between the {} gets regular rule highlighting,
// which is what we want for page and font-face
// attribute values
{
begin: '@(page|font-face)',
lexemes: AT_IDENTIFIER,
keywords: '@page @font-face'
begin: ':',
end: '[;}]',
contains: [
modes.HEXCOLOR,
modes.IMPORTANT,
hljs.CSS_NUMBER_MODE,
...STRINGS,
// needed to highlight these as strings and to avoid issues with
// illegal characters that might be inside urls that would tigger the
// languages illegal stack
{
begin: /(url|data-uri)\(/,
end: /\)/,
relevance: 0, // from keywords
keywords: {
built_in: "url data-uri"
},
contains: [
{
className: "string",
// any character other than `)` as in `url()` will be the start
// of a string, which ends with `)` (from the parent mode)
begin: /[^)]/,
endsWithParent: true,
excludeEnd: true
}
]
},
FUNCTION_DISPATCH
]
},
{
begin: '@', end: '[{;]', // at_rule eating first "{" is a good thing
// because it doesn’t let it to be parsed as
// a rule set but instead drops parser into
// the default mode which is how it should be.
begin: lookahead(/@/),
end: '[{;]',
relevance: 0,
illegal: /:/, // break on Less variables @var: ...
returnBegin: true,
contains: [

@@ -105,12 +581,17 @@ {

{
begin: /\s/, endsWithParent: true, excludeEnd: true,
begin: /\s/,
endsWithParent: true,
excludeEnd: true,
relevance: 0,
keywords: AT_MODIFIERS,
keywords: {
$pattern: /[a-z-]+/,
keyword: AT_MODIFIERS,
attribute: MEDIA_FEATURES.join(" ")
},
contains: [
{
begin: /[a-z-]+:/,
className:"attribute"
begin: /[a-z-]+(?=:)/,
className: "attribute"
},
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
...STRINGS,
hljs.CSS_NUMBER_MODE

@@ -122,13 +603,4 @@ ]

{
className: 'selector-tag', begin: IDENT_RE,
relevance: 0
},
{
begin: /\{/, end: /\}/,
illegal: /\S/,
contains: [
hljs.C_BLOCK_COMMENT_MODE,
{ begin: /;/ }, // empty ; rule
RULE,
]
className: 'selector-tag',
begin: '\\b(' + TAGS.join('|') + ')\\b'
}

@@ -135,0 +607,0 @@ ]

@@ -145,3 +145,3 @@ /*

'window'
]).join(' '),
]),
$pattern: /[A-Za-z][A-Za-z0-9_]*\??/

@@ -148,0 +148,0 @@ };

@@ -140,3 +140,3 @@ /*

end: /"""/,
contains: []
contains: [] // override default
},

@@ -146,3 +146,3 @@ {

end: /"/,
contains: []
contains: [] // override default
},

@@ -152,3 +152,3 @@ {

end: /'''/,
contains: []
contains: [] // override default
},

@@ -158,3 +158,3 @@ {

end: /'/,
contains: []
contains: [] // override default
},

@@ -161,0 +161,0 @@ {

@@ -119,2 +119,26 @@ /*

const DIRECTIVES = [
"-module",
"-record",
"-undef",
"-export",
"-ifdef",
"-ifndef",
"-author",
"-copyright",
"-doc",
"-vsn",
"-import",
"-include",
"-include_lib",
"-compile",
"-define",
"-else",
"-endif",
"-file",
"-behaviour",
"-behavior",
"-spec"
];
const PARAMS = {

@@ -159,5 +183,3 @@ className: 'params',

$pattern: '-' + hljs.IDENT_RE,
keyword: '-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' +
'-import -include -include_lib -compile -define -else -endif -file -behaviour ' +
'-behavior -spec'
keyword: DIRECTIVES.map(x => `${x}|1.5`).join(" ")
},

@@ -164,0 +186,0 @@ contains: [PARAMS]

@@ -25,2 +25,3 @@ /*

className: 'title',
relevance: 0,
begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/

@@ -27,0 +28,0 @@ };

@@ -828,3 +828,3 @@ /*

'argument9 argument10 argument11 argument12 argument13 argument14 ' +
'argument15 argument_count x y xprevious yprevious xstart ystart ' +
'argument15 argument_count x|0 y|0 xprevious yprevious xstart ystart ' +
'hspeed vspeed direction speed friction gravity gravity_direction ' +

@@ -831,0 +831,0 @@ 'path_index path_position path_positionprevious path_speed ' +

@@ -55,10 +55,12 @@ /**

{
relevance : 0,
contains : [
relevance: 0,
contains: [
{
// eat up @'s in emails to prevent them to be recognized as doctags
begin: /\w+@/, relevance: 0
}, {
className : 'doctag',
begin : '@[A-Za-z]+'
begin: /\w+@/,
relevance: 0
},
{
className: 'doctag',
begin: '@[A-Za-z]+'
}

@@ -72,9 +74,7 @@ ]

begin: /~?\/[^\/\n]+\//,
contains: [
hljs.BACKSLASH_ESCAPE
]
contains: [ hljs.BACKSLASH_ESCAPE ]
};
const NUMBER = variants([
hljs.BINARY_NUMBER_MODE,
hljs.C_NUMBER_MODE,
hljs.C_NUMBER_MODE
]);

@@ -85,6 +85,8 @@ const STRING = variants([

end: /"""/
}, {
},
{
begin: /'''/,
end: /'''/
}, {
},
{
begin: "\\$/",

@@ -95,13 +97,15 @@ end: "/\\$",

hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
],
{ className: "string" }
hljs.QUOTE_STRING_MODE
],
{
className: "string"
}
);
return {
name: 'Groovy',
keywords: {
built_in: 'this super',
literal: 'true false null',
keyword:
return {
name: 'Groovy',
keywords: {
built_in: 'this super',
literal: 'true false null',
keyword:
'byte short char int long boolean float double void ' +

@@ -114,57 +118,62 @@ // groovy specific keywords

'throw throws try catch finally implements extends new import package return instanceof'
},
},
contains: [
hljs.SHEBANG({
binary: "groovy",
relevance: 10
}),
COMMENT,
STRING,
REGEXP,
NUMBER,
{
className: 'class',
beginKeywords: 'class interface trait enum',
end: /\{/,
illegal: ':',
contains: [
hljs.SHEBANG({
binary: "groovy",
relevance: 10
}),
COMMENT,
STRING,
REGEXP,
NUMBER,
{
className: 'class',
beginKeywords: 'class interface trait enum', end: /\{/,
illegal: ':',
contains: [
{beginKeywords: 'extends implements'},
hljs.UNDERSCORE_TITLE_MODE
]
},
{
className: 'meta',
begin: '@[A-Za-z]+',
relevance: 0
},
{
// highlight map keys and named parameters as attrs
className: 'attr', begin: IDENT_RE + '[ \t]*:'
},
{
// catch middle element of the ternary operator
// to avoid highlight it as a label, named parameter, or map key
begin: /\?/,
end: /:/,
relevance: 0,
contains: [
COMMENT,
STRING,
REGEXP,
NUMBER,
'self'
]
},
{
// highlight labeled statements
className: 'symbol',
begin: '^[ \t]*' + lookahead(IDENT_RE + ':'),
excludeBegin: true,
end: IDENT_RE + ':',
relevance: 0
}
],
illegal: /#|<\//
};
{
beginKeywords: 'extends implements'
},
hljs.UNDERSCORE_TITLE_MODE
]
},
{
className: 'meta',
begin: '@[A-Za-z]+',
relevance: 0
},
{
// highlight map keys and named parameters as attrs
className: 'attr',
begin: IDENT_RE + '[ \t]*:',
relevance: 0
},
{
// catch middle element of the ternary operator
// to avoid highlight it as a label, named parameter, or map key
begin: /\?/,
end: /:/,
relevance: 0,
contains: [
COMMENT,
STRING,
REGEXP,
NUMBER,
'self'
]
},
{
// highlight labeled statements
className: 'symbol',
begin: '^[ \t]*' + lookahead(IDENT_RE + ':'),
excludeBegin: true,
end: IDENT_RE + ':',
relevance: 0
}
],
illegal: /#|<\//
};
}
module.exports = groovy;

@@ -95,3 +95,3 @@ /**

'yield'
].join(" ")
]
};

@@ -105,3 +105,3 @@

'null'
].join(" ")
]
};

@@ -108,0 +108,0 @@

@@ -95,3 +95,3 @@ /**

'yield'
].join(" ")
]
};

@@ -105,3 +105,3 @@

'null'
].join(" ")
]
};

@@ -108,0 +108,0 @@

@@ -101,2 +101,7 @@ // https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.html#jls-3.10

beginKeywords: 'class interface enum', end: /[{;=]/, excludeEnd: true,
// TODO: can this be removed somehow?
// an extra boost because Java is more popular than other languages with
// this same syntax feature (this is just to preserve our tests passing
// for now)
relevance: 1,
keywords: 'class interface enum',

@@ -103,0 +108,0 @@ illegal: /[:"\[\]]/,

@@ -229,5 +229,5 @@ const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';

$pattern: IDENT_RE,
keyword: KEYWORDS.join(" "),
literal: LITERALS.join(" "),
built_in: BUILT_INS.join(" ")
keyword: KEYWORDS,
literal: LITERALS,
built_in: BUILT_INS
};

@@ -234,0 +234,0 @@

@@ -326,5 +326,5 @@ /*

$pattern: VARIABLE_NAME_RE,
keyword: KEYWORD_LIST.join(" "),
literal: LITERAL_LIST.join(" "),
built_in: BUILT_IN_LIST.join(" "),
keyword: KEYWORD_LIST,
literal: LITERAL_LIST,
built_in: BUILT_IN_LIST,
};

@@ -331,0 +331,0 @@

@@ -0,1 +1,431 @@

const MODES = (hljs) => {
return {
IMPORTANT: {
className: 'meta',
begin: '!important'
},
HEXCOLOR: {
className: 'number',
begin: '#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})'
},
ATTRIBUTE_SELECTOR_MODE: {
className: 'selector-attr',
begin: /\[/,
end: /\]/,
illegal: '$',
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
}
};
};
const TAGS = [
'a',
'abbr',
'address',
'article',
'aside',
'audio',
'b',
'blockquote',
'body',
'button',
'canvas',
'caption',
'cite',
'code',
'dd',
'del',
'details',
'dfn',
'div',
'dl',
'dt',
'em',
'fieldset',
'figcaption',
'figure',
'footer',
'form',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'header',
'hgroup',
'html',
'i',
'iframe',
'img',
'input',
'ins',
'kbd',
'label',
'legend',
'li',
'main',
'mark',
'menu',
'nav',
'object',
'ol',
'p',
'q',
'quote',
'samp',
'section',
'span',
'strong',
'summary',
'sup',
'table',
'tbody',
'td',
'textarea',
'tfoot',
'th',
'thead',
'time',
'tr',
'ul',
'var',
'video'
];
const MEDIA_FEATURES = [
'any-hover',
'any-pointer',
'aspect-ratio',
'color',
'color-gamut',
'color-index',
'device-aspect-ratio',
'device-height',
'device-width',
'display-mode',
'forced-colors',
'grid',
'height',
'hover',
'inverted-colors',
'monochrome',
'orientation',
'overflow-block',
'overflow-inline',
'pointer',
'prefers-color-scheme',
'prefers-contrast',
'prefers-reduced-motion',
'prefers-reduced-transparency',
'resolution',
'scan',
'scripting',
'update',
'width',
// TODO: find a better solution?
'min-width',
'max-width',
'min-height',
'max-height'
];
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
const PSEUDO_CLASSES = [
'active',
'any-link',
'blank',
'checked',
'current',
'default',
'defined',
'dir', // dir()
'disabled',
'drop',
'empty',
'enabled',
'first',
'first-child',
'first-of-type',
'fullscreen',
'future',
'focus',
'focus-visible',
'focus-within',
'has', // has()
'host', // host or host()
'host-context', // host-context()
'hover',
'indeterminate',
'in-range',
'invalid',
'is', // is()
'lang', // lang()
'last-child',
'last-of-type',
'left',
'link',
'local-link',
'not', // not()
'nth-child', // nth-child()
'nth-col', // nth-col()
'nth-last-child', // nth-last-child()
'nth-last-col', // nth-last-col()
'nth-last-of-type', //nth-last-of-type()
'nth-of-type', //nth-of-type()
'only-child',
'only-of-type',
'optional',
'out-of-range',
'past',
'placeholder-shown',
'read-only',
'read-write',
'required',
'right',
'root',
'scope',
'target',
'target-within',
'user-invalid',
'valid',
'visited',
'where' // where()
];
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements
const PSEUDO_ELEMENTS = [
'after',
'backdrop',
'before',
'cue',
'cue-region',
'first-letter',
'first-line',
'grammar-error',
'marker',
'part',
'placeholder',
'selection',
'slotted',
'spelling-error'
];
const ATTRIBUTES = [
'align-content',
'align-items',
'align-self',
'animation',
'animation-delay',
'animation-direction',
'animation-duration',
'animation-fill-mode',
'animation-iteration-count',
'animation-name',
'animation-play-state',
'animation-timing-function',
'auto',
'backface-visibility',
'background',
'background-attachment',
'background-clip',
'background-color',
'background-image',
'background-origin',
'background-position',
'background-repeat',
'background-size',
'border',
'border-bottom',
'border-bottom-color',
'border-bottom-left-radius',
'border-bottom-right-radius',
'border-bottom-style',
'border-bottom-width',
'border-collapse',
'border-color',
'border-image',
'border-image-outset',
'border-image-repeat',
'border-image-slice',
'border-image-source',
'border-image-width',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-radius',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-style',
'border-top',
'border-top-color',
'border-top-left-radius',
'border-top-right-radius',
'border-top-style',
'border-top-width',
'border-width',
'bottom',
'box-decoration-break',
'box-shadow',
'box-sizing',
'break-after',
'break-before',
'break-inside',
'caption-side',
'clear',
'clip',
'clip-path',
'color',
'column-count',
'column-fill',
'column-gap',
'column-rule',
'column-rule-color',
'column-rule-style',
'column-rule-width',
'column-span',
'column-width',
'columns',
'content',
'counter-increment',
'counter-reset',
'cursor',
'direction',
'display',
'empty-cells',
'filter',
'flex',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-grow',
'flex-shrink',
'flex-wrap',
'float',
'font',
'font-display',
'font-family',
'font-feature-settings',
'font-kerning',
'font-language-override',
'font-size',
'font-size-adjust',
'font-stretch',
'font-style',
'font-variant',
'font-variant-ligatures',
'font-variation-settings',
'font-weight',
'height',
'hyphens',
'icon',
'image-orientation',
'image-rendering',
'image-resolution',
'ime-mode',
'inherit',
'initial',
'justify-content',
'left',
'letter-spacing',
'line-height',
'list-style',
'list-style-image',
'list-style-position',
'list-style-type',
'margin',
'margin-bottom',
'margin-left',
'margin-right',
'margin-top',
'marks',
'mask',
'max-height',
'max-width',
'min-height',
'min-width',
'nav-down',
'nav-index',
'nav-left',
'nav-right',
'nav-up',
'none',
'normal',
'object-fit',
'object-position',
'opacity',
'order',
'orphans',
'outline',
'outline-color',
'outline-offset',
'outline-style',
'outline-width',
'overflow',
'overflow-wrap',
'overflow-x',
'overflow-y',
'padding',
'padding-bottom',
'padding-left',
'padding-right',
'padding-top',
'page-break-after',
'page-break-before',
'page-break-inside',
'perspective',
'perspective-origin',
'pointer-events',
'position',
'quotes',
'resize',
'right',
'src', // @font-face
'tab-size',
'table-layout',
'text-align',
'text-align-last',
'text-decoration',
'text-decoration-color',
'text-decoration-line',
'text-decoration-style',
'text-indent',
'text-overflow',
'text-rendering',
'text-shadow',
'text-transform',
'text-underline-position',
'top',
'transform',
'transform-origin',
'transform-style',
'transition',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'unicode-bidi',
'vertical-align',
'visibility',
'white-space',
'widows',
'width',
'word-break',
'word-spacing',
'word-wrap',
'z-index'
// reverse makes sure longer attributes `font-weight` are matched fully
// instead of getting false positives on say `font`
].reverse();
// some grammars use them all as a single group
const PSEUDO_SELECTORS = PSEUDO_CLASSES.concat(PSEUDO_ELEMENTS);
/*

@@ -9,26 +439,48 @@ Language: Less

/** @type LanguageFn */
function less(hljs) {
var IDENT_RE = '[\\w-]+'; // yes, Less identifiers may begin with a digit
var INTERP_IDENT_RE = '(' + IDENT_RE + '|@\\{' + IDENT_RE + '\\})';
const modes = MODES(hljs);
const PSEUDO_SELECTORS$1 = PSEUDO_SELECTORS;
const AT_MODIFIERS = "and or not only";
const IDENT_RE = '[\\w-]+'; // yes, Less identifiers may begin with a digit
const INTERP_IDENT_RE = '(' + IDENT_RE + '|@\\{' + IDENT_RE + '\\})';
/* Generic Modes */
var RULES = [], VALUE = []; // forward def. for recursive modes
const RULES = []; const VALUE_MODES = []; // forward def. for recursive modes
var STRING_MODE = function(c) { return {
const STRING_MODE = function(c) {
return {
// Less strings are not multiline (also include '~' for more consistent coloring of "escaped" strings)
className: 'string', begin: '~?' + c + '.*?' + c
};};
className: 'string',
begin: '~?' + c + '.*?' + c
};
};
var IDENT_MODE = function(name, begin, relevance) { return {
className: name, begin: begin, relevance: relevance
};};
const IDENT_MODE = function(name, begin, relevance) {
return {
className: name,
begin: begin,
relevance: relevance
};
};
var PARENS_MODE = {
const AT_KEYWORDS = {
$pattern: /[a-z-]+/,
keyword: AT_MODIFIERS,
attribute: MEDIA_FEATURES.join(" ")
};
const PARENS_MODE = {
// used only to properly balance nested parens inside mixin call, def. arg list
begin: '\\(', end: '\\)', contains: VALUE, relevance: 0
begin: '\\(',
end: '\\)',
contains: VALUE_MODES,
keywords: AT_KEYWORDS,
relevance: 0
};
// generic Less highlighter (used almost everywhere except selectors):
VALUE.push(
VALUE_MODES.push(
hljs.C_LINE_COMMENT_MODE,

@@ -41,25 +493,37 @@ hljs.C_BLOCK_COMMENT_MODE,

begin: '(url|data-uri)\\(',
starts: {className: 'string', end: '[\\)\\n]', excludeEnd: true}
starts: {
className: 'string',
end: '[\\)\\n]',
excludeEnd: true
}
},
IDENT_MODE('number', '#[0-9A-Fa-f]+\\b'),
modes.HEXCOLOR,
PARENS_MODE,
IDENT_MODE('variable', '@@?' + IDENT_RE, 10),
IDENT_MODE('variable', '@\\{' + IDENT_RE + '\\}'),
IDENT_MODE('variable', '@\\{' + IDENT_RE + '\\}'),
IDENT_MODE('built_in', '~?`[^`]*?`'), // inline javascript (or whatever host language) *multiline* string
{ // @media features (it’s here to not duplicate things in AT_RULE_MODE with extra PARENS_MODE overriding):
className: 'attribute', begin: IDENT_RE + '\\s*:', end: ':', returnBegin: true, excludeEnd: true
className: 'attribute',
begin: IDENT_RE + '\\s*:',
end: ':',
returnBegin: true,
excludeEnd: true
},
{
className: 'meta',
begin: '!important'
}
modes.IMPORTANT
);
var VALUE_WITH_RULESETS = VALUE.concat({
begin: /\{/, end: /\}/, contains: RULES
const VALUE_WITH_RULESETS = VALUE_MODES.concat({
begin: /\{/,
end: /\}/,
contains: RULES
});
var MIXIN_GUARD_MODE = {
beginKeywords: 'when', endsWithParent: true,
contains: [{beginKeywords: 'and not'}].concat(VALUE) // using this form to override VALUE’s 'function' match
const MIXIN_GUARD_MODE = {
beginKeywords: 'when',
endsWithParent: true,
contains: [
{
beginKeywords: 'and not'
}
].concat(VALUE_MODES) // using this form to override VALUE’s 'function' match
};

@@ -69,13 +533,20 @@

var RULE_MODE = {
begin: INTERP_IDENT_RE + '\\s*:', returnBegin: true, end: '[;}]',
const RULE_MODE = {
begin: INTERP_IDENT_RE + '\\s*:',
returnBegin: true,
end: /[;}]/,
relevance: 0,
contains: [
{
begin: /-(webkit|moz|ms|o)-/
},
{
className: 'attribute',
begin: INTERP_IDENT_RE, end: ':', excludeEnd: true,
begin: '\\b(' + ATTRIBUTES.join('|') + ')\\b',
end: /(?=:)/,
starts: {
endsWithParent: true, illegal: '[<=$]',
endsWithParent: true,
illegal: '[<=$]',
relevance: 0,
contains: VALUE
contains: VALUE_MODES
}

@@ -86,10 +557,16 @@ }

var AT_RULE_MODE = {
const AT_RULE_MODE = {
className: 'keyword',
begin: '@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b',
starts: {end: '[;{}]', returnEnd: true, contains: VALUE, relevance: 0}
starts: {
end: '[;{}]',
keywords: AT_KEYWORDS,
returnEnd: true,
contains: VALUE_MODES,
relevance: 0
}
};
// variable definitions and calls
var VAR_RULE_MODE = {
const VAR_RULE_MODE = {
className: 'variable',

@@ -101,19 +578,33 @@ variants: [

// simply because 1 variable just can't beat 99 properties :)
{begin: '@' + IDENT_RE + '\\s*:', relevance: 15},
{begin: '@' + IDENT_RE}
{
begin: '@' + IDENT_RE + '\\s*:',
relevance: 15
},
{
begin: '@' + IDENT_RE
}
],
starts: {end: '[;}]', returnEnd: true, contains: VALUE_WITH_RULESETS}
starts: {
end: '[;}]',
returnEnd: true,
contains: VALUE_WITH_RULESETS
}
};
var SELECTOR_MODE = {
const SELECTOR_MODE = {
// first parse unambiguous selectors (i.e. those not starting with tag)
// then fall into the scary lookahead-discriminator variant.
// this mode also handles mixin definitions and calls
variants: [{
begin: '[\\.#:&\\[>]', end: '[;{}]' // mixin calls end with ';'
}, {
begin: INTERP_IDENT_RE, end: /\{/
}],
variants: [
{
begin: '[\\.#:&\\[>]',
end: '[;{}]' // mixin calls end with ';'
},
{
begin: INTERP_IDENT_RE,
end: /\{/
}
],
returnBegin: true,
returnEnd: true,
returnEnd: true,
illegal: '[<=\'$"]',

@@ -125,15 +616,38 @@ relevance: 0,

MIXIN_GUARD_MODE,
IDENT_MODE('keyword', 'all\\b'),
IDENT_MODE('variable', '@\\{' + IDENT_RE + '\\}'), // otherwise it’s identified as tag
IDENT_MODE('selector-tag', INTERP_IDENT_RE + '%?', 0), // '%' for more consistent coloring of @keyframes "tags"
IDENT_MODE('keyword', 'all\\b'),
IDENT_MODE('variable', '@\\{' + IDENT_RE + '\\}'), // otherwise it’s identified as tag
{
begin: '\\b(' + TAGS.join('|') + ')\\b',
className: 'selector-tag'
},
IDENT_MODE('selector-tag', INTERP_IDENT_RE + '%?', 0), // '%' for more consistent coloring of @keyframes "tags"
IDENT_MODE('selector-id', '#' + INTERP_IDENT_RE),
IDENT_MODE('selector-class', '\\.' + INTERP_IDENT_RE, 0),
IDENT_MODE('selector-tag', '&', 0),
{className: 'selector-attr', begin: '\\[', end: '\\]'},
{className: 'selector-pseudo', begin: /:(:)?[a-zA-Z0-9_\-+()"'.]+/},
{begin: '\\(', end: '\\)', contains: VALUE_WITH_RULESETS}, // argument list of parametric mixins
{begin: '!important'} // eat !important after mixin call or it will be colored as tag
IDENT_MODE('selector-tag', '&', 0),
modes.ATTRIBUTE_SELECTOR_MODE,
{
className: 'selector-pseudo',
begin: ':(' + PSEUDO_CLASSES.join('|') + ')'
},
{
className: 'selector-pseudo',
begin: '::(' + PSEUDO_ELEMENTS.join('|') + ')'
},
{
begin: '\\(',
end: '\\)',
contains: VALUE_WITH_RULESETS
}, // argument list of parametric mixins
{
begin: '!important'
} // eat !important after mixin call or it will be colored as tag
]
};
const PSEUDO_SELECTOR_MODE = {
begin: IDENT_RE + ':(:)?' + `(${PSEUDO_SELECTORS$1.join('|')})`,
returnBegin: true,
contains: [ SELECTOR_MODE ]
};
RULES.push(

@@ -144,2 +658,3 @@ hljs.C_LINE_COMMENT_MODE,

VAR_RULE_MODE,
PSEUDO_SELECTOR_MODE,
RULE_MODE,

@@ -146,0 +661,0 @@ SELECTOR_MODE

@@ -194,5 +194,5 @@ const KEYWORDS = [

const KEYWORDS$1 = {
keyword: KEYWORDS.concat(LIVESCRIPT_KEYWORDS).join(" "),
literal: LITERALS.concat(LIVESCRIPT_LITERALS).join(" "),
built_in: BUILT_INS.concat(LIVESCRIPT_BUILT_INS).join(" ")
keyword: KEYWORDS.concat(LIVESCRIPT_KEYWORDS),
literal: LITERALS.concat(LIVESCRIPT_LITERALS),
built_in: BUILT_INS.concat(LIVESCRIPT_BUILT_INS)
};

@@ -199,0 +199,0 @@ const JS_IDENT_RE = '[A-Za-z$_](?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*';

@@ -165,3 +165,3 @@ /**

className: 'strong',
contains: [],
contains: [], // defined later
variants: [

@@ -180,3 +180,3 @@ {

className: 'emphasis',
contains: [],
contains: [], // defined later
variants: [

@@ -183,0 +183,0 @@ {

@@ -26,2 +26,14 @@ /**

/**
* Any of the passed expresssions may match
*
* Creates a huge this | this | that | that match
* @param {(RegExp | string)[] } args
* @returns {string}
*/
function either(...args) {
const joined = '(' + args.map((x) => source(x)).join("|") + ")";
return joined;
}
/*

@@ -36,25 +48,240 @@ Language: Perl

function perl(hljs) {
const KEYWORDS = [
'abs',
'accept',
'alarm',
'and',
'atan2',
'bind',
'binmode',
'bless',
'break',
'caller',
'chdir',
'chmod',
'chomp',
'chop',
'chown',
'chr',
'chroot',
'close',
'closedir',
'connect',
'continue',
'cos',
'crypt',
'dbmclose',
'dbmopen',
'defined',
'delete',
'die',
'do',
'dump',
'each',
'else',
'elsif',
'endgrent',
'endhostent',
'endnetent',
'endprotoent',
'endpwent',
'endservent',
'eof',
'eval',
'exec',
'exists',
'exit',
'exp',
'fcntl',
'fileno',
'flock',
'for',
'foreach',
'fork',
'format',
'formline',
'getc',
'getgrent',
'getgrgid',
'getgrnam',
'gethostbyaddr',
'gethostbyname',
'gethostent',
'getlogin',
'getnetbyaddr',
'getnetbyname',
'getnetent',
'getpeername',
'getpgrp',
'getpriority',
'getprotobyname',
'getprotobynumber',
'getprotoent',
'getpwent',
'getpwnam',
'getpwuid',
'getservbyname',
'getservbyport',
'getservent',
'getsockname',
'getsockopt',
'given',
'glob',
'gmtime',
'goto',
'grep',
'gt',
'hex',
'if',
'index',
'int',
'ioctl',
'join',
'keys',
'kill',
'last',
'lc',
'lcfirst',
'length',
'link',
'listen',
'local',
'localtime',
'log',
'lstat',
'lt',
'ma',
'map',
'mkdir',
'msgctl',
'msgget',
'msgrcv',
'msgsnd',
'my',
'ne',
'next',
'no',
'not',
'oct',
'open',
'opendir',
'or',
'ord',
'our',
'pack',
'package',
'pipe',
'pop',
'pos',
'print',
'printf',
'prototype',
'push',
'q|0',
'qq',
'quotemeta',
'qw',
'qx',
'rand',
'read',
'readdir',
'readline',
'readlink',
'readpipe',
'recv',
'redo',
'ref',
'rename',
'require',
'reset',
'return',
'reverse',
'rewinddir',
'rindex',
'rmdir',
'say',
'scalar',
'seek',
'seekdir',
'select',
'semctl',
'semget',
'semop',
'send',
'setgrent',
'sethostent',
'setnetent',
'setpgrp',
'setpriority',
'setprotoent',
'setpwent',
'setservent',
'setsockopt',
'shift',
'shmctl',
'shmget',
'shmread',
'shmwrite',
'shutdown',
'sin',
'sleep',
'socket',
'socketpair',
'sort',
'splice',
'split',
'sprintf',
'sqrt',
'srand',
'stat',
'state',
'study',
'sub',
'substr',
'symlink',
'syscall',
'sysopen',
'sysread',
'sysseek',
'system',
'syswrite',
'tell',
'telldir',
'tie',
'tied',
'time',
'times',
'tr',
'truncate',
'uc',
'ucfirst',
'umask',
'undef',
'unless',
'unlink',
'unpack',
'unshift',
'untie',
'until',
'use',
'utime',
'values',
'vec',
'wait',
'waitpid',
'wantarray',
'warn',
'when',
'while',
'write',
'x|0',
'xor',
'y|0'
];
// https://perldoc.perl.org/perlre#Modifiers
const REGEX_MODIFIERS = /[dualxmsipn]{0,12}/; // aa and xx are valid, making max length 12
const REGEX_MODIFIERS = /[dualxmsipngr]{0,12}/; // aa and xx are valid, making max length 12
const PERL_KEYWORDS = {
$pattern: /[\w.]+/,
keyword: 'getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ' +
'ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime ' +
'readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq ' +
'fileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent ' +
'shutdown dump chomp connect getsockname die socketpair close flock exists index shmget ' +
'sub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr ' +
'unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 ' +
'getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline ' +
'endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand ' +
'mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink ' +
'getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr ' +
'untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link ' +
'getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller ' +
'lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and ' +
'sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 ' +
'chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach ' +
'tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir ' +
'ioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe ' +
'atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when'
keyword: KEYWORDS.join(" ")
};

@@ -96,2 +323,44 @@ const SUBST = {

];
const REGEX_DELIMS = [
/!/,
/\//,
/\|/,
/\?/,
/'/,
/"/, // valid but infrequent and weird
/#/ // valid but infrequent and weird
];
/**
* @param {string|RegExp} prefix
* @param {string|RegExp} open
* @param {string|RegExp} close
*/
const PAIRED_DOUBLE_RE = (prefix, open, close = '\\1') => {
const middle = (close === '\\1')
? close
: concat(close, open);
return concat(
concat("(?:", prefix, ")"),
open,
/(?:\\.|[^\\\/])*?/,
middle,
/(?:\\.|[^\\\/])*?/,
close,
REGEX_MODIFIERS
);
};
/**
* @param {string|RegExp} prefix
* @param {string|RegExp} open
* @param {string|RegExp} close
*/
const PAIRED_RE = (prefix, open, close) => {
return concat(
concat("(?:", prefix, ")"),
open,
/(?:\\.|[^\\\/])*?/,
close,
REGEX_MODIFIERS
);
};
const PERL_DEFAULT_CONTAINS = [

@@ -158,3 +427,2 @@ VAR,

begin: /\{\w+\}/,
contains: [],
relevance: 0

@@ -164,3 +432,2 @@ },

begin: '-?\\w+\\s*=>',
contains: [],
relevance: 0

@@ -183,22 +450,30 @@ }

className: 'regexp',
begin: concat(
/(s|tr|y)/,
/\//,
/(\\.|[^\\\/])*/,
/\//,
/(\\.|[^\\\/])*/,
/\//,
REGEX_MODIFIERS
),
relevance: 10
variants: [
// allow matching common delimiters
{ begin: PAIRED_DOUBLE_RE("s|tr|y", either(...REGEX_DELIMS)) },
// and then paired delmis
{ begin: PAIRED_DOUBLE_RE("s|tr|y", "\\(", "\\)") },
{ begin: PAIRED_DOUBLE_RE("s|tr|y", "\\[", "\\]") },
{ begin: PAIRED_DOUBLE_RE("s|tr|y", "\\{", "\\}") }
],
relevance: 2
},
{
className: 'regexp',
begin: /(m|qr)?\//,
end: concat(
/\//,
REGEX_MODIFIERS
),
contains: [ hljs.BACKSLASH_ESCAPE ],
relevance: 0 // allows empty "//" which is a common comment delimiter in other languages
variants: [
{
// could be a comment in many languages so do not count
// as relevant
begin: /(m|qr)\/\//,
relevance: 0
},
// prefix is optional with /regex/
{ begin: PAIRED_RE("(?:m|qr)?", /\//, /\//)},
// allow matching common delimiters
{ begin: PAIRED_RE("m|qr", either(...REGEX_DELIMS), /\1/)},
// allow common paired delmins
{ begin: PAIRED_RE("m|qr", /\(/, /\)/)},
{ begin: PAIRED_RE("m|qr", /\[/, /\]/)},
{ begin: PAIRED_RE("m|qr", /\{/, /\}/)}
]
}

@@ -205,0 +480,0 @@ ]

@@ -27,3 +27,3 @@ /*

// https://msdn.microsoft.com/en-us/library/ms714428(v=vs.85).aspx
// https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands
const VALID_VERBS =

@@ -35,5 +35,5 @@ 'Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|' +

'ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|' +
'Limit|Merge|Out|Publish|Restore|Save|Sync|Unpublish|Update|' +
'Approve|Assert|Complete|Confirm|Deny|Disable|Enable|Install|Invoke|Register|' +
'Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|' +
'Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|' +
'Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|' +
'Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|' +
'Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|' +

@@ -40,0 +40,0 @@ 'Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|' +

@@ -127,5 +127,5 @@ /*

const KEYWORDS = {
keyword: RESERVED_WORDS.join(' '),
built_in: BUILT_INS.join(' '),
literal: LITERALS.join(' ')
keyword: RESERVED_WORDS,
built_in: BUILT_INS,
literal: LITERALS
};

@@ -132,0 +132,0 @@

@@ -95,4 +95,6 @@ /*

VAR,
{ // attribute=value
begin: /[\w-]+=([^\s{}[\]()]+)/,
// attribute=value
{
// > is to avoid matches with => in other grammars
begin: /[\w-]+=([^\s{}[\]()>]+)/,
relevance: 0,

@@ -99,0 +101,0 @@ returnBegin: true,

@@ -44,4 +44,4 @@ /**

function ruby(hljs) {
var RUBY_METHOD_RE = '([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)';
var RUBY_KEYWORDS = {
const RUBY_METHOD_RE = '([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)';
const RUBY_KEYWORDS = {
keyword:

@@ -56,10 +56,11 @@ 'and then defined module in return redo if BEGIN retry end for self when ' +

};
var YARDOCTAG = {
const YARDOCTAG = {
className: 'doctag',
begin: '@[A-Za-z]+'
};
var IRB_OBJECT = {
begin: '#<', end: '>'
const IRB_OBJECT = {
begin: '#<',
end: '>'
};
var COMMENT_MODES = [
const COMMENT_MODES = [
hljs.COMMENT(

@@ -69,3 +70,3 @@ '#',

{
contains: [YARDOCTAG]
contains: [ YARDOCTAG ]
}

@@ -77,3 +78,3 @@ ),

{
contains: [YARDOCTAG],
contains: [ YARDOCTAG ],
relevance: 10

@@ -84,27 +85,79 @@ }

];
var SUBST = {
const SUBST = {
className: 'subst',
begin: /#\{/, end: /\}/,
begin: /#\{/,
end: /\}/,
keywords: RUBY_KEYWORDS
};
var STRING = {
const STRING = {
className: 'string',
contains: [hljs.BACKSLASH_ESCAPE, SUBST],
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
],
variants: [
{begin: /'/, end: /'/},
{begin: /"/, end: /"/},
{begin: /`/, end: /`/},
{begin: /%[qQwWx]?\(/, end: /\)/},
{begin: /%[qQwWx]?\[/, end: /\]/},
{begin: /%[qQwWx]?\{/, end: /\}/},
{begin: /%[qQwWx]?</, end: />/},
{begin: /%[qQwWx]?\//, end: /\//},
{begin: /%[qQwWx]?%/, end: /%/},
{begin: /%[qQwWx]?-/, end: /-/},
{begin: /%[qQwWx]?\|/, end: /\|/},
{
// \B in the beginning suppresses recognition of ?-sequences where ?
// is the last character of a preceding identifier, as in: `func?4`
begin: /\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/
begin: /'/,
end: /'/
},
{
begin: /"/,
end: /"/
},
{
begin: /`/,
end: /`/
},
{
begin: /%[qQwWx]?\(/,
end: /\)/
},
{
begin: /%[qQwWx]?\[/,
end: /\]/
},
{
begin: /%[qQwWx]?\{/,
end: /\}/
},
{
begin: /%[qQwWx]?</,
end: />/
},
{
begin: /%[qQwWx]?\//,
end: /\//
},
{
begin: /%[qQwWx]?%/,
end: /%/
},
{
begin: /%[qQwWx]?-/,
end: /-/
},
{
begin: /%[qQwWx]?\|/,
end: /\|/
},
// in the following expressions, \B in the beginning suppresses recognition of ?-sequences
// where ? is the last character of a preceding identifier, as in: `func?4`
{
begin: /\B\?(\\\d{1,3})/
},
{
begin: /\B\?(\\x[A-Fa-f0-9]{1,2})/
},
{
begin: /\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/
},
{
begin: /\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/
},
{
begin: /\B\?\\(c|C-)[\x20-\x7e]/
},
{
begin: /\B\?\\?\S/
},
{ // heredocs

@@ -114,6 +167,12 @@ begin: /<<[-~]?'?(\w+)\n(?:[^\n]*\n)*?\s*\1\b/,

contains: [
{ begin: /<<[-~]?'?/ },
{
begin: /<<[-~]?'?/
},
hljs.END_SAME_AS_BEGIN({
begin: /(\w+)/, end: /(\w+)/,
contains: [hljs.BACKSLASH_ESCAPE, SUBST],
begin: /(\w+)/,
end: /(\w+)/,
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
]
})

@@ -128,41 +187,64 @@ ]

// https://docs.ruby-lang.org/en/2.7.0/doc/syntax/literals_rdoc.html#label-Numbers
var decimal = '[1-9](_?[0-9])*|0';
var digits = '[0-9](_?[0-9])*';
var NUMBER = {
className: 'number', relevance: 0,
const decimal = '[1-9](_?[0-9])*|0';
const digits = '[0-9](_?[0-9])*';
const NUMBER = {
className: 'number',
relevance: 0,
variants: [
// decimal integer/float, optionally exponential or rational, optionally imaginary
{ begin: `\\b(${decimal})(\\.(${digits}))?([eE][+-]?(${digits})|r)?i?\\b` },
{
begin: `\\b(${decimal})(\\.(${digits}))?([eE][+-]?(${digits})|r)?i?\\b`
},
// explicit decimal/binary/octal/hexadecimal integer,
// optionally rational and/or imaginary
{ begin: "\\b0[dD][0-9](_?[0-9])*r?i?\\b" },
{ begin: "\\b0[bB][0-1](_?[0-1])*r?i?\\b" },
{ begin: "\\b0[oO][0-7](_?[0-7])*r?i?\\b" },
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b" },
{
begin: "\\b0[dD][0-9](_?[0-9])*r?i?\\b"
},
{
begin: "\\b0[bB][0-1](_?[0-1])*r?i?\\b"
},
{
begin: "\\b0[oO][0-7](_?[0-7])*r?i?\\b"
},
{
begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"
},
// 0-prefixed implicit octal integer, optionally rational and/or imaginary
{ begin: "\\b0(_?[0-7])+r?i?\\b" },
{
begin: "\\b0(_?[0-7])+r?i?\\b"
}
]
};
var PARAMS = {
const PARAMS = {
className: 'params',
begin: '\\(', end: '\\)', endsParent: true,
begin: '\\(',
end: '\\)',
endsParent: true,
keywords: RUBY_KEYWORDS
};
var RUBY_DEFAULT_CONTAINS = [
const RUBY_DEFAULT_CONTAINS = [
STRING,
{
className: 'class',
beginKeywords: 'class module', end: '$|;',
beginKeywords: 'class module',
end: '$|;',
illegal: /=/,
contains: [
hljs.inherit(hljs.TITLE_MODE, {begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|!)?'}),
hljs.inherit(hljs.TITLE_MODE, {
begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|!)?'
}),
{
begin: '<\\s*',
contains: [{
begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE
}]
contains: [
{
begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE,
// we already get points for <, we don't need poitns
// for the name also
relevance: 0
}
]
}

@@ -177,6 +259,9 @@ ].concat(COMMENT_MODES)

begin: concat(/def\s*/, lookahead(RUBY_METHOD_RE + "\\s*(\\(|;|$)")),
relevance: 0, // relevance comes from kewords
keywords: "def",
end: '$|;',
contains: [
hljs.inherit(hljs.TITLE_MODE, {begin: RUBY_METHOD_RE}),
hljs.inherit(hljs.TITLE_MODE, {
begin: RUBY_METHOD_RE
}),
PARAMS

@@ -197,3 +282,8 @@ ].concat(COMMENT_MODES)

begin: ':(?!\\s)',
contains: [STRING, {begin: RUBY_METHOD_RE}],
contains: [
STRING,
{
begin: RUBY_METHOD_RE
}
],
relevance: 0

@@ -212,3 +302,3 @@ },

end: /\|/,
relevance:0, // this could be a lot of things (in other languages) other than params
relevance: 0, // this could be a lot of things (in other languages) other than params
keywords: RUBY_KEYWORDS

@@ -222,10 +312,28 @@ },

className: 'regexp',
contains: [hljs.BACKSLASH_ESCAPE, SUBST],
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
],
illegal: /\n/,
variants: [
{begin: '/', end: '/[a-z]*'},
{begin: /%r\{/, end: /\}[a-z]*/},
{begin: '%r\\(', end: '\\)[a-z]*'},
{begin: '%r!', end: '![a-z]*'},
{begin: '%r\\[', end: '\\][a-z]*'}
{
begin: '/',
end: '/[a-z]*'
},
{
begin: /%r\{/,
end: /\}[a-z]*/
},
{
begin: '%r\\(',
end: '\\)[a-z]*'
},
{
begin: '%r!',
end: '![a-z]*'
},
{
begin: '%r\\[',
end: '\\][a-z]*'
}
]

@@ -243,12 +351,13 @@ }

// ?>
var SIMPLE_PROMPT = "[>?]>";
const SIMPLE_PROMPT = "[>?]>";
// irb(main):001:0>
var DEFAULT_PROMPT = "[\\w#]+\\(\\w+\\):\\d+:\\d+>";
var RVM_PROMPT = "(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>";
const DEFAULT_PROMPT = "[\\w#]+\\(\\w+\\):\\d+:\\d+>";
const RVM_PROMPT = "(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>";
var IRB_DEFAULT = [
const IRB_DEFAULT = [
{
begin: /^\s*=>/,
starts: {
end: '$', contains: RUBY_DEFAULT_CONTAINS
end: '$',
contains: RUBY_DEFAULT_CONTAINS
}

@@ -258,5 +367,6 @@ },

className: 'meta',
begin: '^('+SIMPLE_PROMPT+"|"+DEFAULT_PROMPT+'|'+RVM_PROMPT+')(?=[ ])',
begin: '^(' + SIMPLE_PROMPT + "|" + DEFAULT_PROMPT + '|' + RVM_PROMPT + ')(?=[ ])',
starts: {
end: '$', contains: RUBY_DEFAULT_CONTAINS
end: '$',
contains: RUBY_DEFAULT_CONTAINS
}

@@ -270,8 +380,16 @@ }

name: 'Ruby',
aliases: ['rb', 'gemspec', 'podspec', 'thor', 'irb'],
aliases: [
'rb',
'gemspec',
'podspec',
'thor',
'irb'
],
keywords: RUBY_KEYWORDS,
illegal: /\/\*/,
contains: [
hljs.SHEBANG({binary:"ruby"}),
]
hljs.SHEBANG({
binary: "ruby"
})
]
.concat(IRB_DEFAULT)

@@ -278,0 +396,0 @@ .concat(COMMENT_MODES)

@@ -33,2 +33,6 @@ /*

{
begin: '"""',
end: '"""'
},
{
begin: '"',

@@ -40,12 +44,9 @@ end: '"',

{
begin: '"""',
end: '"""',
relevance: 10
},
{
begin: '[a-z]+"',
end: '"',
illegal: '\\n',
contains: [ hljs.BACKSLASH_ESCAPE,
SUBST ]
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
]
},

@@ -52,0 +53,0 @@ {

@@ -0,1 +1,428 @@

const MODES = (hljs) => {
return {
IMPORTANT: {
className: 'meta',
begin: '!important'
},
HEXCOLOR: {
className: 'number',
begin: '#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})'
},
ATTRIBUTE_SELECTOR_MODE: {
className: 'selector-attr',
begin: /\[/,
end: /\]/,
illegal: '$',
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
}
};
};
const TAGS = [
'a',
'abbr',
'address',
'article',
'aside',
'audio',
'b',
'blockquote',
'body',
'button',
'canvas',
'caption',
'cite',
'code',
'dd',
'del',
'details',
'dfn',
'div',
'dl',
'dt',
'em',
'fieldset',
'figcaption',
'figure',
'footer',
'form',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'header',
'hgroup',
'html',
'i',
'iframe',
'img',
'input',
'ins',
'kbd',
'label',
'legend',
'li',
'main',
'mark',
'menu',
'nav',
'object',
'ol',
'p',
'q',
'quote',
'samp',
'section',
'span',
'strong',
'summary',
'sup',
'table',
'tbody',
'td',
'textarea',
'tfoot',
'th',
'thead',
'time',
'tr',
'ul',
'var',
'video'
];
const MEDIA_FEATURES = [
'any-hover',
'any-pointer',
'aspect-ratio',
'color',
'color-gamut',
'color-index',
'device-aspect-ratio',
'device-height',
'device-width',
'display-mode',
'forced-colors',
'grid',
'height',
'hover',
'inverted-colors',
'monochrome',
'orientation',
'overflow-block',
'overflow-inline',
'pointer',
'prefers-color-scheme',
'prefers-contrast',
'prefers-reduced-motion',
'prefers-reduced-transparency',
'resolution',
'scan',
'scripting',
'update',
'width',
// TODO: find a better solution?
'min-width',
'max-width',
'min-height',
'max-height'
];
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
const PSEUDO_CLASSES = [
'active',
'any-link',
'blank',
'checked',
'current',
'default',
'defined',
'dir', // dir()
'disabled',
'drop',
'empty',
'enabled',
'first',
'first-child',
'first-of-type',
'fullscreen',
'future',
'focus',
'focus-visible',
'focus-within',
'has', // has()
'host', // host or host()
'host-context', // host-context()
'hover',
'indeterminate',
'in-range',
'invalid',
'is', // is()
'lang', // lang()
'last-child',
'last-of-type',
'left',
'link',
'local-link',
'not', // not()
'nth-child', // nth-child()
'nth-col', // nth-col()
'nth-last-child', // nth-last-child()
'nth-last-col', // nth-last-col()
'nth-last-of-type', //nth-last-of-type()
'nth-of-type', //nth-of-type()
'only-child',
'only-of-type',
'optional',
'out-of-range',
'past',
'placeholder-shown',
'read-only',
'read-write',
'required',
'right',
'root',
'scope',
'target',
'target-within',
'user-invalid',
'valid',
'visited',
'where' // where()
];
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements
const PSEUDO_ELEMENTS = [
'after',
'backdrop',
'before',
'cue',
'cue-region',
'first-letter',
'first-line',
'grammar-error',
'marker',
'part',
'placeholder',
'selection',
'slotted',
'spelling-error'
];
const ATTRIBUTES = [
'align-content',
'align-items',
'align-self',
'animation',
'animation-delay',
'animation-direction',
'animation-duration',
'animation-fill-mode',
'animation-iteration-count',
'animation-name',
'animation-play-state',
'animation-timing-function',
'auto',
'backface-visibility',
'background',
'background-attachment',
'background-clip',
'background-color',
'background-image',
'background-origin',
'background-position',
'background-repeat',
'background-size',
'border',
'border-bottom',
'border-bottom-color',
'border-bottom-left-radius',
'border-bottom-right-radius',
'border-bottom-style',
'border-bottom-width',
'border-collapse',
'border-color',
'border-image',
'border-image-outset',
'border-image-repeat',
'border-image-slice',
'border-image-source',
'border-image-width',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-radius',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-style',
'border-top',
'border-top-color',
'border-top-left-radius',
'border-top-right-radius',
'border-top-style',
'border-top-width',
'border-width',
'bottom',
'box-decoration-break',
'box-shadow',
'box-sizing',
'break-after',
'break-before',
'break-inside',
'caption-side',
'clear',
'clip',
'clip-path',
'color',
'column-count',
'column-fill',
'column-gap',
'column-rule',
'column-rule-color',
'column-rule-style',
'column-rule-width',
'column-span',
'column-width',
'columns',
'content',
'counter-increment',
'counter-reset',
'cursor',
'direction',
'display',
'empty-cells',
'filter',
'flex',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-grow',
'flex-shrink',
'flex-wrap',
'float',
'font',
'font-display',
'font-family',
'font-feature-settings',
'font-kerning',
'font-language-override',
'font-size',
'font-size-adjust',
'font-stretch',
'font-style',
'font-variant',
'font-variant-ligatures',
'font-variation-settings',
'font-weight',
'height',
'hyphens',
'icon',
'image-orientation',
'image-rendering',
'image-resolution',
'ime-mode',
'inherit',
'initial',
'justify-content',
'left',
'letter-spacing',
'line-height',
'list-style',
'list-style-image',
'list-style-position',
'list-style-type',
'margin',
'margin-bottom',
'margin-left',
'margin-right',
'margin-top',
'marks',
'mask',
'max-height',
'max-width',
'min-height',
'min-width',
'nav-down',
'nav-index',
'nav-left',
'nav-right',
'nav-up',
'none',
'normal',
'object-fit',
'object-position',
'opacity',
'order',
'orphans',
'outline',
'outline-color',
'outline-offset',
'outline-style',
'outline-width',
'overflow',
'overflow-wrap',
'overflow-x',
'overflow-y',
'padding',
'padding-bottom',
'padding-left',
'padding-right',
'padding-top',
'page-break-after',
'page-break-before',
'page-break-inside',
'perspective',
'perspective-origin',
'pointer-events',
'position',
'quotes',
'resize',
'right',
'src', // @font-face
'tab-size',
'table-layout',
'text-align',
'text-align-last',
'text-decoration',
'text-decoration-color',
'text-decoration-line',
'text-decoration-style',
'text-indent',
'text-overflow',
'text-rendering',
'text-shadow',
'text-transform',
'text-underline-position',
'top',
'transform',
'transform-origin',
'transform-style',
'transition',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'unicode-bidi',
'vertical-align',
'visibility',
'white-space',
'widows',
'width',
'word-break',
'word-spacing',
'word-wrap',
'z-index'
// reverse makes sure longer attributes `font-weight` are matched fully
// instead of getting false positives on say `font`
].reverse();
/*

@@ -8,32 +435,17 @@ Language: SCSS

*/
/** @type LanguageFn */
function scss(hljs) {
var AT_IDENTIFIER = '@[a-z-]+'; // @font-face
var AT_MODIFIERS = "and or not only";
var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
var VARIABLE = {
const modes = MODES(hljs);
const PSEUDO_ELEMENTS$1 = PSEUDO_ELEMENTS;
const PSEUDO_CLASSES$1 = PSEUDO_CLASSES;
const AT_IDENTIFIER = '@[a-z-]+'; // @font-face
const AT_MODIFIERS = "and or not only";
const IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
const VARIABLE = {
className: 'variable',
begin: '(\\$' + IDENT_RE + ')\\b'
};
var HEXCOLOR = {
className: 'number', begin: '#[0-9A-Fa-f]+'
};
var DEF_INTERNALS = {
className: 'attribute',
begin: '[A-Z\\_\\.\\-]+', end: ':',
excludeEnd: true,
illegal: '[^\\s]',
starts: {
endsWithParent: true, excludeEnd: true,
contains: [
HEXCOLOR,
hljs.CSS_NUMBER_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'meta', begin: '!important'
}
]
}
};
return {

@@ -47,16 +459,16 @@ name: 'SCSS',

{
className: 'selector-id', begin: '#[A-Za-z0-9_-]+',
className: 'selector-id',
begin: '#[A-Za-z0-9_-]+',
relevance: 0
},
{
className: 'selector-class', begin: '\\.[A-Za-z0-9_-]+',
className: 'selector-class',
begin: '\\.[A-Za-z0-9_-]+',
relevance: 0
},
modes.ATTRIBUTE_SELECTOR_MODE,
{
className: 'selector-attr', begin: '\\[', end: '\\]',
illegal: '$'
},
{
className: 'selector-tag', // begin: IDENT_RE, end: '[,|\\s]'
begin: '\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b',
className: 'selector-tag',
begin: '\\b(' + TAGS.join('|') + ')\\b',
// was there, before, but why?
relevance: 0

@@ -66,13 +478,17 @@ },

className: 'selector-pseudo',
begin: ':(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)'
begin: ':(' + PSEUDO_CLASSES$1.join('|') + ')'
},
{
className: 'selector-pseudo',
begin: '::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)'
begin: '::(' + PSEUDO_ELEMENTS$1.join('|') + ')'
},
VARIABLE,
{ // pseudo-selector params
begin: /\(/,
end: /\)/,
contains: [ hljs.CSS_NUMBER_MODE ]
},
{
className: 'attribute',
begin: '\\b(src|z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b',
illegal: '[^\\s]'
begin: '\\b(' + ATTRIBUTES.join('|') + ')\\b'
},

@@ -83,12 +499,11 @@ {

{
begin: ':', end: ';',
begin: ':',
end: ';',
contains: [
VARIABLE,
HEXCOLOR,
modes.HEXCOLOR,
hljs.CSS_NUMBER_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
{
className: 'meta', begin: '!important'
}
modes.IMPORTANT
]

@@ -105,5 +520,10 @@ },

{
begin: '@', end: '[{;]',
begin: '@',
end: '[{;]',
returnBegin: true,
keywords: AT_MODIFIERS,
keywords: {
$pattern: /[a-z-]+/,
keyword: AT_MODIFIERS,
attribute: MEDIA_FEATURES.join(" ")
},
contains: [

@@ -114,11 +534,11 @@ {

},
{
begin: /[a-z-]+(?=:)/,
className: "attribute"
},
VARIABLE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
HEXCOLOR,
hljs.CSS_NUMBER_MODE,
// {
// begin: '\\s[A-Za-z0-9_.-]+',
// relevance: 0
// }
modes.HEXCOLOR,
hljs.CSS_NUMBER_MODE
]

@@ -125,0 +545,0 @@ }

@@ -641,3 +641,3 @@ /**

keywords: {
built_in: FUNCTIONS.join(" ")
built_in: FUNCTIONS
}

@@ -669,6 +669,6 @@ };

keyword:
reduceRelevancy(KEYWORDS, { when: (x) => x.length < 3 }).join(" "),
literal: LITERALS.join(" "),
type: TYPES.join(" "),
built_in: POSSIBLE_WITHOUT_PARENS.join(" ")
reduceRelevancy(KEYWORDS, { when: (x) => x.length < 3 }),
literal: LITERALS,
type: TYPES,
built_in: POSSIBLE_WITHOUT_PARENS
},

@@ -680,5 +680,5 @@ contains: [

$pattern: /[\w\.]+/,
keyword: KEYWORDS.concat(COMBOS).join(" "),
literal: LITERALS.join(" "),
type: TYPES.join(" ")
keyword: KEYWORDS.concat(COMBOS),
literal: LITERALS,
type: TYPES
},

@@ -685,0 +685,0 @@ },

@@ -476,5 +476,5 @@ /*

$pattern: hljs.IDENT_RE,
title: BLOCKS.join(' '),
keyword: STATEMENTS.concat(VAR_TYPES).concat(SPECIAL_FUNCTIONS).join(' '),
built_in: FUNCTIONS.join(' ')
title: BLOCKS,
keyword: STATEMENTS.concat(VAR_TYPES).concat(SPECIAL_FUNCTIONS),
built_in: FUNCTIONS
},

@@ -525,3 +525,3 @@ contains: [

begin: '~\\s*(' + hljs.IDENT_RE + ')\\s*\\(',
keywords: DISTRIBUTIONS.join(' ')
keywords: DISTRIBUTIONS
},

@@ -528,0 +528,0 @@ {

@@ -0,1 +1,428 @@

const MODES = (hljs) => {
return {
IMPORTANT: {
className: 'meta',
begin: '!important'
},
HEXCOLOR: {
className: 'number',
begin: '#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})'
},
ATTRIBUTE_SELECTOR_MODE: {
className: 'selector-attr',
begin: /\[/,
end: /\]/,
illegal: '$',
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
}
};
};
const TAGS = [
'a',
'abbr',
'address',
'article',
'aside',
'audio',
'b',
'blockquote',
'body',
'button',
'canvas',
'caption',
'cite',
'code',
'dd',
'del',
'details',
'dfn',
'div',
'dl',
'dt',
'em',
'fieldset',
'figcaption',
'figure',
'footer',
'form',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'header',
'hgroup',
'html',
'i',
'iframe',
'img',
'input',
'ins',
'kbd',
'label',
'legend',
'li',
'main',
'mark',
'menu',
'nav',
'object',
'ol',
'p',
'q',
'quote',
'samp',
'section',
'span',
'strong',
'summary',
'sup',
'table',
'tbody',
'td',
'textarea',
'tfoot',
'th',
'thead',
'time',
'tr',
'ul',
'var',
'video'
];
const MEDIA_FEATURES = [
'any-hover',
'any-pointer',
'aspect-ratio',
'color',
'color-gamut',
'color-index',
'device-aspect-ratio',
'device-height',
'device-width',
'display-mode',
'forced-colors',
'grid',
'height',
'hover',
'inverted-colors',
'monochrome',
'orientation',
'overflow-block',
'overflow-inline',
'pointer',
'prefers-color-scheme',
'prefers-contrast',
'prefers-reduced-motion',
'prefers-reduced-transparency',
'resolution',
'scan',
'scripting',
'update',
'width',
// TODO: find a better solution?
'min-width',
'max-width',
'min-height',
'max-height'
];
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
const PSEUDO_CLASSES = [
'active',
'any-link',
'blank',
'checked',
'current',
'default',
'defined',
'dir', // dir()
'disabled',
'drop',
'empty',
'enabled',
'first',
'first-child',
'first-of-type',
'fullscreen',
'future',
'focus',
'focus-visible',
'focus-within',
'has', // has()
'host', // host or host()
'host-context', // host-context()
'hover',
'indeterminate',
'in-range',
'invalid',
'is', // is()
'lang', // lang()
'last-child',
'last-of-type',
'left',
'link',
'local-link',
'not', // not()
'nth-child', // nth-child()
'nth-col', // nth-col()
'nth-last-child', // nth-last-child()
'nth-last-col', // nth-last-col()
'nth-last-of-type', //nth-last-of-type()
'nth-of-type', //nth-of-type()
'only-child',
'only-of-type',
'optional',
'out-of-range',
'past',
'placeholder-shown',
'read-only',
'read-write',
'required',
'right',
'root',
'scope',
'target',
'target-within',
'user-invalid',
'valid',
'visited',
'where' // where()
];
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements
const PSEUDO_ELEMENTS = [
'after',
'backdrop',
'before',
'cue',
'cue-region',
'first-letter',
'first-line',
'grammar-error',
'marker',
'part',
'placeholder',
'selection',
'slotted',
'spelling-error'
];
const ATTRIBUTES = [
'align-content',
'align-items',
'align-self',
'animation',
'animation-delay',
'animation-direction',
'animation-duration',
'animation-fill-mode',
'animation-iteration-count',
'animation-name',
'animation-play-state',
'animation-timing-function',
'auto',
'backface-visibility',
'background',
'background-attachment',
'background-clip',
'background-color',
'background-image',
'background-origin',
'background-position',
'background-repeat',
'background-size',
'border',
'border-bottom',
'border-bottom-color',
'border-bottom-left-radius',
'border-bottom-right-radius',
'border-bottom-style',
'border-bottom-width',
'border-collapse',
'border-color',
'border-image',
'border-image-outset',
'border-image-repeat',
'border-image-slice',
'border-image-source',
'border-image-width',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-radius',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-style',
'border-top',
'border-top-color',
'border-top-left-radius',
'border-top-right-radius',
'border-top-style',
'border-top-width',
'border-width',
'bottom',
'box-decoration-break',
'box-shadow',
'box-sizing',
'break-after',
'break-before',
'break-inside',
'caption-side',
'clear',
'clip',
'clip-path',
'color',
'column-count',
'column-fill',
'column-gap',
'column-rule',
'column-rule-color',
'column-rule-style',
'column-rule-width',
'column-span',
'column-width',
'columns',
'content',
'counter-increment',
'counter-reset',
'cursor',
'direction',
'display',
'empty-cells',
'filter',
'flex',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-grow',
'flex-shrink',
'flex-wrap',
'float',
'font',
'font-display',
'font-family',
'font-feature-settings',
'font-kerning',
'font-language-override',
'font-size',
'font-size-adjust',
'font-stretch',
'font-style',
'font-variant',
'font-variant-ligatures',
'font-variation-settings',
'font-weight',
'height',
'hyphens',
'icon',
'image-orientation',
'image-rendering',
'image-resolution',
'ime-mode',
'inherit',
'initial',
'justify-content',
'left',
'letter-spacing',
'line-height',
'list-style',
'list-style-image',
'list-style-position',
'list-style-type',
'margin',
'margin-bottom',
'margin-left',
'margin-right',
'margin-top',
'marks',
'mask',
'max-height',
'max-width',
'min-height',
'min-width',
'nav-down',
'nav-index',
'nav-left',
'nav-right',
'nav-up',
'none',
'normal',
'object-fit',
'object-position',
'opacity',
'order',
'orphans',
'outline',
'outline-color',
'outline-offset',
'outline-style',
'outline-width',
'overflow',
'overflow-wrap',
'overflow-x',
'overflow-y',
'padding',
'padding-bottom',
'padding-left',
'padding-right',
'padding-top',
'page-break-after',
'page-break-before',
'page-break-inside',
'perspective',
'perspective-origin',
'pointer-events',
'position',
'quotes',
'resize',
'right',
'src', // @font-face
'tab-size',
'table-layout',
'text-align',
'text-align-last',
'text-decoration',
'text-decoration-color',
'text-decoration-line',
'text-decoration-style',
'text-indent',
'text-overflow',
'text-rendering',
'text-shadow',
'text-transform',
'text-underline-position',
'top',
'transform',
'transform-origin',
'transform-style',
'transition',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'unicode-bidi',
'vertical-align',
'visibility',
'white-space',
'widows',
'width',
'word-break',
'word-spacing',
'word-wrap',
'z-index'
// reverse makes sure longer attributes `font-weight` are matched fully
// instead of getting false positives on say `font`
].reverse();
/*

@@ -9,5 +436,8 @@ Language: Stylus

/** @type LanguageFn */
function stylus(hljs) {
const modes = MODES(hljs);
var VARIABLE = {
const AT_MODIFIERS = "and or not only";
const VARIABLE = {
className: 'variable',

@@ -17,8 +447,3 @@ begin: '\\$' + hljs.IDENT_RE

var HEX_COLOR = {
className: 'number',
begin: '#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})'
};
var AT_KEYWORDS = [
const AT_KEYWORDS = [
'charset',

@@ -32,2 +457,3 @@ 'css',

'include',
'keyframes',
'media',

@@ -40,300 +466,6 @@ 'mixin',

var PSEUDO_SELECTORS = [
'after',
'before',
'first-letter',
'first-line',
'active',
'first-child',
'focus',
'hover',
'lang',
'link',
'visited'
];
const LOOKAHEAD_TAG_END = '(?=[.\\s\\n[:,(])';
var TAGS = [
'a',
'abbr',
'address',
'article',
'aside',
'audio',
'b',
'blockquote',
'body',
'button',
'canvas',
'caption',
'cite',
'code',
'dd',
'del',
'details',
'dfn',
'div',
'dl',
'dt',
'em',
'fieldset',
'figcaption',
'figure',
'footer',
'form',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'header',
'hgroup',
'html',
'i',
'iframe',
'img',
'input',
'ins',
'kbd',
'label',
'legend',
'li',
'mark',
'menu',
'nav',
'object',
'ol',
'p',
'q',
'quote',
'samp',
'section',
'span',
'strong',
'summary',
'sup',
'table',
'tbody',
'td',
'textarea',
'tfoot',
'th',
'thead',
'time',
'tr',
'ul',
'var',
'video'
];
var LOOKAHEAD_TAG_END = '(?=[.\\s\\n[:,])';
var ATTRIBUTES = [
'align-content',
'align-items',
'align-self',
'animation',
'animation-delay',
'animation-direction',
'animation-duration',
'animation-fill-mode',
'animation-iteration-count',
'animation-name',
'animation-play-state',
'animation-timing-function',
'auto',
'backface-visibility',
'background',
'background-attachment',
'background-clip',
'background-color',
'background-image',
'background-origin',
'background-position',
'background-repeat',
'background-size',
'border',
'border-bottom',
'border-bottom-color',
'border-bottom-left-radius',
'border-bottom-right-radius',
'border-bottom-style',
'border-bottom-width',
'border-collapse',
'border-color',
'border-image',
'border-image-outset',
'border-image-repeat',
'border-image-slice',
'border-image-source',
'border-image-width',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-radius',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-style',
'border-top',
'border-top-color',
'border-top-left-radius',
'border-top-right-radius',
'border-top-style',
'border-top-width',
'border-width',
'bottom',
'box-decoration-break',
'box-shadow',
'box-sizing',
'break-after',
'break-before',
'break-inside',
'caption-side',
'clear',
'clip',
'clip-path',
'color',
'column-count',
'column-fill',
'column-gap',
'column-rule',
'column-rule-color',
'column-rule-style',
'column-rule-width',
'column-span',
'column-width',
'columns',
'content',
'counter-increment',
'counter-reset',
'cursor',
'direction',
'display',
'empty-cells',
'filter',
'flex',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-grow',
'flex-shrink',
'flex-wrap',
'float',
'font',
'font-family',
'font-feature-settings',
'font-kerning',
'font-language-override',
'font-size',
'font-size-adjust',
'font-stretch',
'font-style',
'font-variant',
'font-variant-ligatures',
'font-weight',
'height',
'hyphens',
'icon',
'image-orientation',
'image-rendering',
'image-resolution',
'ime-mode',
'inherit',
'initial',
'justify-content',
'left',
'letter-spacing',
'line-height',
'list-style',
'list-style-image',
'list-style-position',
'list-style-type',
'margin',
'margin-bottom',
'margin-left',
'margin-right',
'margin-top',
'marks',
'mask',
'max-height',
'max-width',
'min-height',
'min-width',
'nav-down',
'nav-index',
'nav-left',
'nav-right',
'nav-up',
'none',
'normal',
'object-fit',
'object-position',
'opacity',
'order',
'orphans',
'outline',
'outline-color',
'outline-offset',
'outline-style',
'outline-width',
'overflow',
'overflow-wrap',
'overflow-x',
'overflow-y',
'padding',
'padding-bottom',
'padding-left',
'padding-right',
'padding-top',
'page-break-after',
'page-break-before',
'page-break-inside',
'perspective',
'perspective-origin',
'pointer-events',
'position',
'quotes',
'resize',
'right',
'tab-size',
'table-layout',
'text-align',
'text-align-last',
'text-decoration',
'text-decoration-color',
'text-decoration-line',
'text-decoration-style',
'text-indent',
'text-overflow',
'text-rendering',
'text-shadow',
'text-transform',
'text-underline-position',
'top',
'transform',
'transform-origin',
'transform-style',
'transition',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'unicode-bidi',
'vertical-align',
'visibility',
'white-space',
'widows',
'width',
'word-break',
'word-spacing',
'word-wrap',
'z-index'
];
// illegals
var ILLEGAL = [
const ILLEGAL = [
'\\?',

@@ -349,3 +481,3 @@ '(\\bReturn\\b)', // monkey

'\\|',
'%', // prolog
'%' // prolog
];

@@ -355,3 +487,3 @@

name: 'Stylus',
aliases: ['styl'],
aliases: [ 'styl' ],
case_insensitive: false,

@@ -371,3 +503,3 @@ keywords: 'if else for in',

// hex colors
HEX_COLOR,
modes.HEXCOLOR,

@@ -394,8 +526,30 @@ // class tag

{
begin: '&?:?:\\b(' + PSEUDO_SELECTORS.join('|') + ')' + LOOKAHEAD_TAG_END
className: 'selector-pseudo',
begin: '&?:(' + PSEUDO_CLASSES.join('|') + ')' + LOOKAHEAD_TAG_END
},
{
className: 'selector-pseudo',
begin: '&?::(' + PSEUDO_ELEMENTS.join('|') + ')' + LOOKAHEAD_TAG_END
},
modes.ATTRIBUTE_SELECTOR_MODE,
{
className: "keyword",
begin: /@media/,
starts: {
end: /[{;}]/,
keywords: {
$pattern: /[a-z-]+/,
keyword: AT_MODIFIERS,
attribute: MEDIA_FEATURES.join(" ")
},
contains: [ hljs.CSS_NUMBER_MODE ]
}
},
// @ keywords
{
begin: '\@(' + AT_KEYWORDS.join('|') + ')\\b'
className: 'keyword',
begin: '\@((-(o|moz|ms|webkit)-)?(' + AT_KEYWORDS.join('|') + '))\\b'
},

@@ -409,5 +563,2 @@

// number
hljs.NUMBER_MODE,
// functions

@@ -421,4 +572,7 @@ // - only from beginning of line + whitespace

contains: [
{className: 'title', begin: '\\b[a-zA-Z][a-zA-Z0-9_\-]*'},
{
className: 'title',
begin: '\\b[a-zA-Z][a-zA-Z0-9_\-]*'
},
{
className: 'params',

@@ -428,7 +582,6 @@ begin: /\(/,

contains: [
HEX_COLOR,
modes.HEXCOLOR,
VARIABLE,
hljs.APOS_STRING_MODE,
hljs.CSS_NUMBER_MODE,
hljs.NUMBER_MODE,
hljs.QUOTE_STRING_MODE

@@ -445,3 +598,3 @@ ]

className: 'attribute',
begin: '\\b(' + ATTRIBUTES.reverse().join('|') + ')\\b',
begin: '\\b(' + ATTRIBUTES.join('|') + ')\\b',
starts: {

@@ -451,3 +604,3 @@ // value container

contains: [
HEX_COLOR,
modes.HEXCOLOR,
VARIABLE,

@@ -457,4 +610,4 @@ hljs.APOS_STRING_MODE,

hljs.CSS_NUMBER_MODE,
hljs.NUMBER_MODE,
hljs.C_BLOCK_COMMENT_MODE
hljs.C_BLOCK_COMMENT_MODE,
modes.IMPORTANT
],

@@ -461,0 +614,0 @@ illegal: /\./,

@@ -95,3 +95,3 @@ /**

'fallthrough',
'fileprivate(set)',
/fileprivate\(set\)/,
'fileprivate',

@@ -110,3 +110,3 @@ 'final', // contextual

'inout',
'internal(set)',
/internal\(set\)/,
'internal',

@@ -119,3 +119,3 @@ 'in',

'nonmutating', // contextual
'open(set)', // contextual
/open\(set\)/, // contextual
'open', // contextual

@@ -128,6 +128,6 @@ 'operator',

'prefix', // contextual
'private(set)',
/private\(set\)/,
'private',
'protocol',
'public(set)',
/public\(set\)/,
'public',

@@ -151,4 +151,4 @@ 'repeat',

'typealias',
'unowned(safe)', // contextual
'unowned(unsafe)', // contextual
/unowned\(safe\)/, // contextual
/unowned\(unsafe\)/, // contextual
'unowned', // contextual

@@ -165,6 +165,2 @@ 'var',

// TODO: Create a PRECEDENCE_GROUP mode to match the remaining contextual keywords:
// assignment associativity higherThan left lowerThan none right
// These aren't included in the list because they result in mostly false positives.
// Literals.

@@ -177,2 +173,13 @@ const literals = [

// Keywords used in precedence groups.
const precedencegroupKeywords = [
'assignment',
'associativity',
'higherThan',
'left',
'lowerThan',
'none',
'right'
];
// Keywords that start with a number sign (#).

@@ -290,3 +297,3 @@ // #available is handled separately.

/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,
/[\uFE47-\uFFFD]/
/[\uFE47-\uFEFE\uFF00-\uFFFD]/ // Should be /[\uFE47-\uFFFD]/, but we have to exclude FEFF.
// The following characters are also allowed, but the regexes aren't supported yet.

@@ -371,2 +378,6 @@ // /[\u{10000}-\u{1FFFD}\u{20000-\u{2FFFD}\u{30000}-\u{3FFFD}\u{40000}-\u{4FFFD}]/u,

function swift(hljs) {
const WHITESPACE = {
match: /\s+/,
relevance: 0
};
// https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID411

@@ -380,2 +391,6 @@ const BLOCK_COMMENT = hljs.COMMENT(

);
const COMMENTS = [
hljs.C_LINE_COMMENT_MODE,
BLOCK_COMMENT
];

@@ -392,3 +407,3 @@ // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID413

// Consume .keyword to prevent highlighting properties and methods as keywords.
begin: concat(/\./, either(...keywords)),
match: concat(/\./, either(...keywords)),
relevance: 0

@@ -407,3 +422,3 @@ };

className: 'keyword',
begin: either(...REGEX_KEYWORDS, ...optionalDotKeywords)
match: either(...REGEX_KEYWORDS, ...optionalDotKeywords)
}

@@ -415,9 +430,8 @@ ]

$pattern: either(
/\b\w+(\(\w+\))?/, // kw or kw(arg)
/\b\w+/, // regular keywords
/#\w+/ // number keywords
),
keyword: PLAIN_KEYWORDS
.concat(numberSignKeywords)
.join(" "),
literal: literals.join(" ")
.concat(numberSignKeywords),
literal: literals
};

@@ -433,3 +447,3 @@ const KEYWORD_MODES = [

// Consume .built_in to prevent highlighting properties and methods.
begin: concat(/\./, either(...builtIns)),
match: concat(/\./, either(...builtIns)),
relevance: 0

@@ -439,3 +453,3 @@ };

className: 'built_in',
begin: concat(/\b/, either(...builtIns), /(?=\()/)
match: concat(/\b/, either(...builtIns), /(?=\()/)
};

@@ -450,3 +464,3 @@ const BUILT_INS = [

// Prevent -> from being highlighting as an operator.
begin: /->/,
match: /->/,
relevance: 0

@@ -459,3 +473,3 @@ };

{
begin: operator
match: operator
},

@@ -466,3 +480,3 @@ {

// characters that may also include dots.
begin: `\\.(\\.|${operatorCharacter})+`
match: `\\.(\\.|${operatorCharacter})+`
}

@@ -486,15 +500,15 @@ ]

{
begin: `\\b(${decimalDigits})(\\.(${decimalDigits}))?` + `([eE][+-]?(${decimalDigits}))?\\b`
match: `\\b(${decimalDigits})(\\.(${decimalDigits}))?` + `([eE][+-]?(${decimalDigits}))?\\b`
},
// hexadecimal floating-point-literal (subsumes hexadecimal-literal)
{
begin: `\\b0x(${hexDigits})(\\.(${hexDigits}))?` + `([pP][+-]?(${decimalDigits}))?\\b`
match: `\\b0x(${hexDigits})(\\.(${hexDigits}))?` + `([pP][+-]?(${decimalDigits}))?\\b`
},
// octal-literal
{
begin: /\b0o([0-7]_*)+\b/
match: /\b0o([0-7]_*)+\b/
},
// binary-literal
{
begin: /\b0b([01]_*)+\b/
match: /\b0b([01]_*)+\b/
}

@@ -509,6 +523,6 @@ ]

{
begin: concat(/\\/, rawDelimiter, /[0\\tnr"']/)
match: concat(/\\/, rawDelimiter, /[0\\tnr"']/)
},
{
begin: concat(/\\/, rawDelimiter, /u\{[0-9a-fA-F]{1,8}\}/)
match: concat(/\\/, rawDelimiter, /u\{[0-9a-fA-F]{1,8}\}/)
}

@@ -519,3 +533,3 @@ ]

className: 'subst',
begin: concat(/\\/, rawDelimiter, /[\t ]*(?:[\r\n]|\r\n)/)
match: concat(/\\/, rawDelimiter, /[\t ]*(?:[\r\n]|\r\n)/)
});

@@ -561,11 +575,11 @@ const INTERPOLATION = (rawDelimiter = "") => ({

const QUOTED_IDENTIFIER = {
begin: concat(/`/, identifier, /`/)
match: concat(/`/, identifier, /`/)
};
const IMPLICIT_PARAMETER = {
className: 'variable',
begin: /\$\d+/
match: /\$\d+/
};
const PROPERTY_WRAPPER_PROJECTION = {
className: 'variable',
begin: `\\$${identifierCharacter}+`
match: `\\$${identifierCharacter}+`
};

@@ -580,26 +594,26 @@ const IDENTIFIERS = [

const AVAILABLE_ATTRIBUTE = {
begin: /(@|#)available\(/,
end: /\)/,
keywords: {
$pattern: /[@#]?\w+/,
keyword: availabilityKeywords
.concat([
"@available",
"#available"
])
.join(' ')
},
contains: [
...OPERATORS,
NUMBER,
STRING
]
match: /(@|#)available/,
className: "keyword",
starts: {
contains: [
{
begin: /\(/,
end: /\)/,
keywords: availabilityKeywords,
contains: [
...OPERATORS,
NUMBER,
STRING
]
}
]
}
};
const KEYWORD_ATTRIBUTE = {
className: 'keyword',
begin: concat(/@/, either(...keywordAttributes))
match: concat(/@/, either(...keywordAttributes))
};
const USER_DEFINED_ATTRIBUTE = {
className: 'meta',
begin: concat(/@/, identifier)
match: concat(/@/, identifier)
};

@@ -614,3 +628,3 @@ const ATTRIBUTES = [

const TYPE = {
begin: lookahead(/\b[A-Z]/),
match: lookahead(/\b[A-Z]/),
relevance: 0,

@@ -620,19 +634,19 @@ contains: [

className: 'type',
begin: concat(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/, identifierCharacter, '+')
match: concat(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/, identifierCharacter, '+')
},
{ // Type identifier
className: 'type',
begin: typeIdentifier,
match: typeIdentifier,
relevance: 0
},
{ // Optional type
begin: /[?!]+/,
match: /[?!]+/,
relevance: 0
},
{ // Variadic parameter
begin: /\.\.\./,
match: /\.\.\./,
relevance: 0
},
{ // Protocol composition
begin: concat(/\s+&\s+/, lookahead(typeIdentifier)),
match: concat(/\s+&\s+/, lookahead(typeIdentifier)),
relevance: 0

@@ -647,2 +661,3 @@ }

contains: [
...COMMENTS,
...KEYWORD_MODES,

@@ -656,2 +671,161 @@ ...ATTRIBUTES,

// https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#ID552
// Prevents element names from being highlighted as keywords.
const TUPLE_ELEMENT_NAME = {
match: concat(identifier, /\s*:/),
keywords: "_|0",
relevance: 0
};
// Matches tuples as well as the parameter list of a function type.
const TUPLE = {
begin: /\(/,
end: /\)/,
relevance: 0,
keywords: KEYWORDS,
contains: [
'self',
TUPLE_ELEMENT_NAME,
...COMMENTS,
...KEYWORD_MODES,
...BUILT_INS,
...OPERATORS,
NUMBER,
STRING,
...IDENTIFIERS,
...ATTRIBUTES,
TYPE
]
};
// https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID362
// Matches both the keyword func and the function title.
// Grouping these lets us differentiate between the operator function <
// and the start of the generic parameter clause (also <).
const FUNC_PLUS_TITLE = {
beginKeywords: 'func',
contains: [
{
className: 'title',
match: either(QUOTED_IDENTIFIER.match, identifier, operator),
// Required to make sure the opening < of the generic parameter clause
// isn't parsed as a second title.
endsParent: true,
relevance: 0
},
WHITESPACE
]
};
const GENERIC_PARAMETERS = {
begin: /</,
end: />/,
contains: [
...COMMENTS,
TYPE
]
};
const FUNCTION_PARAMETER_NAME = {
begin: either(
lookahead(concat(identifier, /\s*:/)),
lookahead(concat(identifier, /\s+/, identifier, /\s*:/))
),
end: /:/,
relevance: 0,
contains: [
{
className: 'keyword',
match: /\b_\b/
},
{
className: 'params',
match: identifier
}
]
};
const FUNCTION_PARAMETERS = {
begin: /\(/,
end: /\)/,
keywords: KEYWORDS,
contains: [
FUNCTION_PARAMETER_NAME,
...COMMENTS,
...KEYWORD_MODES,
...OPERATORS,
NUMBER,
STRING,
...ATTRIBUTES,
TYPE,
TUPLE
],
endsParent: true,
illegal: /["']/
};
const FUNCTION = {
className: 'function',
match: lookahead(/\bfunc\b/),
contains: [
FUNC_PLUS_TITLE,
GENERIC_PARAMETERS,
FUNCTION_PARAMETERS,
WHITESPACE
],
illegal: [
/\[/,
/%/
]
};
// https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID375
// https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID379
const INIT_SUBSCRIPT = {
className: 'function',
match: /\b(subscript|init[?!]?)\s*(?=[<(])/,
keywords: {
keyword: "subscript init init? init!",
$pattern: /\w+[?!]?/
},
contains: [
GENERIC_PARAMETERS,
FUNCTION_PARAMETERS,
WHITESPACE
],
illegal: /\[|%/
};
// https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID380
const OPERATOR_DECLARATION = {
beginKeywords: 'operator',
end: hljs.MATCH_NOTHING_RE,
contains: [
{
className: 'title',
match: operator,
endsParent: true,
relevance: 0
}
]
};
// https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID550
const PRECEDENCEGROUP = {
beginKeywords: 'precedencegroup',
end: hljs.MATCH_NOTHING_RE,
contains: [
{
className: 'title',
match: typeIdentifier,
relevance: 0
},
{
begin: /{/,
end: /}/,
relevance: 0,
endsParent: true,
keywords: [
...precedencegroupKeywords,
...literals
],
contains: [ TYPE ]
}
]
};
// Add supported submodes to string interpolation.

@@ -687,39 +861,6 @@ for (const variant of STRING.variants) {

contains: [
hljs.C_LINE_COMMENT_MODE,
BLOCK_COMMENT,
...COMMENTS,
FUNCTION,
INIT_SUBSCRIPT,
{
className: 'function',
beginKeywords: 'func',
end: /\{/,
excludeEnd: true,
contains: [
hljs.inherit(hljs.TITLE_MODE, {
begin: /[A-Za-z$_][0-9A-Za-z$_]*/
}),
{
begin: /</,
end: />/
},
{
className: 'params',
begin: /\(/,
end: /\)/,
endsParent: true,
keywords: KEYWORDS,
contains: [
'self',
...KEYWORD_MODES,
NUMBER,
STRING,
hljs.C_BLOCK_COMMENT_MODE,
{ // relevance booster
begin: ':'
}
],
illegal: /["']/
}
],
illegal: /\[|%/
},
{
className: 'class',

@@ -737,9 +878,8 @@ beginKeywords: 'struct protocol class extension enum',

},
OPERATOR_DECLARATION,
PRECEDENCEGROUP,
{
beginKeywords: 'import',
end: /$/,
contains: [
hljs.C_LINE_COMMENT_MODE,
BLOCK_COMMENT
],
contains: [ ...COMMENTS ],
relevance: 0

@@ -754,3 +894,4 @@ },

...ATTRIBUTES,
TYPE
TYPE,
TUPLE
]

@@ -757,0 +898,0 @@ };

@@ -229,5 +229,5 @@ const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';

$pattern: IDENT_RE,
keyword: KEYWORDS.join(" "),
literal: LITERALS.join(" "),
built_in: BUILT_INS.join(" ")
keyword: KEYWORDS,
literal: LITERALS,
built_in: BUILT_INS
};

@@ -651,5 +651,5 @@

$pattern: IDENT_RE,
keyword: KEYWORDS.concat(TS_SPECIFIC_KEYWORDS).join(" "),
literal: LITERALS.join(" "),
built_in: BUILT_INS.concat(TYPES).join(" ")
keyword: KEYWORDS.concat(TS_SPECIFIC_KEYWORDS),
literal: LITERALS,
built_in: BUILT_INS.concat(TYPES)
};

@@ -656,0 +656,0 @@ const DECORATOR = {

@@ -75,3 +75,3 @@ /**

keywords: {
built_in: BUILT_IN_FUNCTIONS.join(" ")
built_in: BUILT_IN_FUNCTIONS
}

@@ -90,3 +90,3 @@ };

'class_initialize class_terminate default preserve in me byval byref step resume goto',
built_in: BUILT_IN_OBJECTS.join(" "),
built_in: BUILT_IN_OBJECTS,
literal:

@@ -93,0 +93,0 @@ 'true false null nothing empty'

@@ -64,3 +64,3 @@ /**

// Element names can contain letters, digits, hyphens, underscores, and periods
const TAG_NAME_RE = concat(/[A-Z_]/, optional(/[A-Z0-9_.-]+:/), /[A-Z0-9_.-]*/);
const TAG_NAME_RE = concat(/[A-Z_]/, optional(/[A-Z0-9_.-]*:/), /[A-Z0-9_.-]*/);
const XML_IDENT_RE = /[A-Za-z0-9._:-]+/;

@@ -67,0 +67,0 @@ const XML_ENTITIES = {

@@ -73,3 +73,2 @@ /*

excludeEnd: true,
contains: [],
keywords: LITERALS,

@@ -76,0 +75,0 @@ relevance: 0

@@ -9,3 +9,3 @@ {

"homepage": "https://highlightjs.org/",
"version": "10.5.0",
"version": "10.6.0",
"author": {

@@ -312,3 +312,5 @@ "name": "Ivan Sagalaev",

"Steven Van Impe <steven.vanimpe@icloud.com>",
"Martin Dørum <martid0311@gmail.com>"
"Martin Dørum <martid0311@gmail.com>",
"John Haugeland <stonecypher@gmail.com>",
"davidhcefx <davidhu0903ex3@gmail.com>"
],

@@ -345,9 +347,9 @@ "bugs": {

"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.0.1",
"@rollup/plugin-node-resolve": "^11.1.0",
"@typescript-eslint/eslint-plugin": "^4.6.1",
"@typescript-eslint/parser": "^4.6.1",
"clean-css": "^4.2.3",
"clean-css": "^5.0.1",
"cli-table": "^0.3.1",
"colors": "^1.1.2",
"commander": "^6.2.0",
"commander": "^7.0.0",
"deep-freeze-es6": "^1.4.1",

@@ -361,7 +363,5 @@ "del": "^6.0.0",

"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^5.0.0",
"glob": "^7.1.6",
"glob-promise": "^3.4.0",
"glob-promise": "^4.0.1",
"handlebars": "^4.7.6",
"js-beautify": "^1.13.0",
"jsdom": "^16.4.0",

@@ -368,0 +368,0 @@ "lodash": "^4.17.20",

@@ -15,5 +15,5 @@ # Highlight.js

[![build and CI status](https://badgen.net/github/checks/highlightjs/highlight.js?label=build)](https://github.com/highlightjs/highlight.js/actions?query=workflow%3A%22Node.js+CI%22)
[![open issues](https://badgen.net/github/open-issues/highlightjs/highlight.js?label=issues&labelColor=orange&color=c41)](https://github.com/highlightjs/highlight.js/issues)
[![help welcome issues](https://badgen.net/github/label-issues/highlightjs/highlight.js/help%20welcome/open?labelColor=393&color=6c6)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+welcome%22)
[![beginner friendly issues](https://badgen.net/github/label-issues/highlightjs/highlight.js/beginner%20friendly/open?labelColor=669&color=99c)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22beginner+friendly%22)
[![open issues](https://badgen.net/github/open-issues/highlightjs/highlight.js?label=issues)](https://github.com/highlightjs/highlight.js/issues)
[![help welcome issues](https://badgen.net/github/label-issues/highlightjs/highlight.js/help%20welcome/open)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+welcome%22)
[![good first issue](https://badgen.net/github/label-issues/highlightjs/highlight.js/good%20first%20issue/open)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22beginner+friendly%22)
[![vulnerabilities](https://badgen.net/snyk/highlightjs/highlight.js)](https://snyk.io/test/github/highlightjs/highlight.js?targetFile=package.json)

@@ -53,3 +53,3 @@

<script src="/path/to/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>hljs.highlightAll();</script>
```

@@ -98,3 +98,3 @@

Here’s the equivalent of calling [`initHighlightingOnLoad`][1] using
Here’s the equivalent of calling [`highlightAll`][1] using
only vanilla JS:

@@ -277,6 +277,6 @@

```html
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/languages/go.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/languages/go.min.js"></script>
```

@@ -287,6 +287,6 @@

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.5.0/build/styles/default.min.css">
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.5.0/build/highlight.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.6.0/build/styles/default.min.css">
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.6.0/build/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.5.0/build/languages/go.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.6.0/build/languages/go.min.js"></script>
```

@@ -297,6 +297,6 @@

```html
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@10.5.0/styles/default.min.css">
<script src="https://unpkg.com/@highlightjs/cdn-assets@10.5.0/highlight.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@10.6.0/styles/default.min.css">
<script src="https://unpkg.com/@highlightjs/cdn-assets@10.6.0/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://unpkg.com/@highlightjs/cdn-assets@10.5.0/languages/go.min.js"></script>
<script src="https://unpkg.com/@highlightjs/cdn-assets@10.6.0/languages/go.min.js"></script>
```

@@ -368,3 +368,3 @@

[1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload
[1]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightall
[2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html

@@ -371,0 +371,0 @@ [3]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightblock-block

@@ -25,2 +25,3 @@ /* eslint-disable no-unused-vars */

initHighlightingOnLoad: () => void
highlightAll: () => void
registerLanguage: (languageName: string, language: LanguageFn) => void

@@ -62,2 +63,3 @@ listLanguages: () => string[]

UNDERSCORE_IDENT_RE: string
MATCH_NOTHING_RE: string
NUMBER_RE: string

@@ -103,3 +105,3 @@ C_NUMBER_RE: string

'before:highlight'?: (context: BeforeHighlightContext) => void,
'after:highlightBlock'?: (data: { result: HighlightResult}) => void,
'after:highlightBlock'?: (data: { block: Element, result: HighlightResult, text: string}) => void,
'before:highlightBlock'?: (data: { block: Element, language: string}) => void,

@@ -106,0 +108,0 @@ }

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc