Socket
Socket
Sign inDemoInstall

highlight.js

Package Overview
Dependencies
Maintainers
2
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 9.6.0 to 9.7.0

6

lib/languages/cpp.js

@@ -29,5 +29,5 @@ module.exports = function(hljs) {

variants: [
{ begin: '\\b(0b[01\'_]+)' },
{ begin: '\\b([\\d\'_]+(\\.[\\d\'_]*)?|\\.[\\d\'_]+)(u|U|l|L|ul|UL|f|F|b|B)' },
{ begin: '(-?)(\\b0[xX][a-fA-F0-9\'_]+|(\\b[\\d\'_]+(\\.[\\d\'_]*)?|\\.[\\d\'_]+)([eE][-+]?[\\d\'_]+)?)' }
{ begin: '\\b(0b[01\']+)' },
{ begin: '\\b([\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)(u|U|l|L|ul|UL|f|F|b|B)' },
{ begin: '(-?)(\\b0[xX][a-fA-F0-9\']+|(\\b[\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)([eE][-+]?[\\d\']+)?)' }
],

@@ -34,0 +34,0 @@ relevance: 0

@@ -5,12 +5,12 @@ module.exports = function(hljs) {

// Normal keywords.
'abstract as base bool break byte case catch char checked const continue decimal dynamic ' +
'abstract as base bool break byte case catch char checked const continue decimal ' +
'default delegate do double else enum event explicit extern finally fixed float ' +
'for foreach goto if implicit in int interface internal is lock long when ' +
'for foreach goto if implicit in int interface internal is lock long ' +
'object operator out override params private protected public readonly ref sbyte ' +
'sealed short sizeof stackalloc static string struct switch this try typeof ' +
'uint ulong unchecked unsafe ushort using virtual volatile void while async ' +
'uint ulong unchecked unsafe ushort using virtual void volatile while ' +
'nameof ' +
// Contextual keywords.
'ascending descending from get group into join let orderby partial select set value var ' +
'where yield',
'add alias ascending async await by descending dynamic equals from get global group into join ' +
'let on orderby partial remove select set value var where yield',
literal:

@@ -75,3 +75,3 @@ 'null false true'

var TYPE_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '>)?(\\[\\])?';
var TYPE_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '(\\s*,\\s*' + hljs.IDENT_RE + ')*>)?(\\[\\])?';
return {

@@ -78,0 +78,0 @@ aliases: ['csharp'],

@@ -9,3 +9,7 @@ module.exports = function(hljs) {

'downto threadvar of try pascal const external constructor type public then implementation ' +
'finally published procedure';
'finally published procedure absolute reintroduce operator as is abstract alias assembler ' +
'bitpacked break continue cppdecl cvar enumerator experimental platform deprecated ' +
'unimplemented dynamic export far16 forward generic helper implements interrupt iochecks ' +
'local name nodefault noreturn nostackframe oldfpccall otherwise saveregisters softfloat ' +
'specialize strict unaligned varargs ';
var COMMENT_MODES = [

@@ -12,0 +16,0 @@ hljs.C_LINE_COMMENT_MODE,

@@ -5,8 +5,10 @@ module.exports = function(hljs) {

case_insensitive: true,
keywords: 'from maintainer cmd expose add copy entrypoint volume user workdir onbuild run env label',
keywords: 'from maintainer expose env user onbuild',
contains: [
hljs.HASH_COMMENT_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE,
{
keywords: 'run cmd entrypoint volume add copy workdir onbuild label',
begin: /^ *(onbuild +)?(run|cmd|entrypoint|volume|add|copy|workdir|label) +/,
beginKeywords: 'run cmd entrypoint volume add copy workdir label healthcheck',
starts: {

@@ -16,15 +18,6 @@ end: /[^\\]\n/,

}
},
{
keywords: 'from maintainer expose env user onbuild',
begin: /^ *(onbuild +)?(from|maintainer|expose|env|user|onbuild) +/, end: /[^\\]\n/,
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE,
hljs.HASH_COMMENT_MODE
]
}
]
],
illegal: '</'
}
};
module.exports = function(hljs) {
var IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
var KEYWORDS = {
keyword:
'in of if for while finally var new function do return void else break catch ' +
'instanceof with throw case default try this switch continue typeof delete ' +
'let yield const export super debugger as async await static ' +
// ECMAScript 6 modules import
'import from as'
,
literal:
'true false null undefined NaN Infinity',
built_in:
'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' +
'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' +
'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' +
'TypeError URIError Number Math Date String RegExp Array Float32Array ' +
'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' +
'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' +
'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' +
'Promise'
};
var EXPRESSIONS;
var NUMBER = {
className: 'number',
variants: [
{ begin: '\\b(0[bB][01]+)' },
{ begin: '\\b(0[oO][0-7]+)' },
{ begin: hljs.C_NUMBER_RE }
],
relevance: 0
};
var SUBST = {
className: 'subst',
begin: '\\$\\{', end: '\\}',
keywords: KEYWORDS,
contains: [] // defined later
};
var TEMPLATE_STRING = {
className: 'string',
begin: '`', end: '`',
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
]
};
SUBST.contains = [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
TEMPLATE_STRING,
NUMBER,
hljs.REGEXP_MODE
]
var PARAMS_CONTAINS = SUBST.contains.concat([
hljs.C_BLOCK_COMMENT_MODE,
hljs.C_LINE_COMMENT_MODE
]);
return {
aliases: ['js', 'jsx'],
keywords: {
keyword:
'in of if for while finally var new function do return void else break catch ' +
'instanceof with throw case default try this switch continue typeof delete ' +
'let yield const export super debugger as async await static ' +
// ECMAScript 6 modules import
'import from as'
,
literal:
'true false null undefined NaN Infinity',
built_in:
'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' +
'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' +
'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' +
'TypeError URIError Number Math Date String RegExp Array Float32Array ' +
'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' +
'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' +
'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' +
'Promise'
},
keywords: KEYWORDS,
contains: [

@@ -36,24 +74,16 @@ {

hljs.QUOTE_STRING_MODE,
{ // template string
className: 'string',
begin: '`', end: '`',
TEMPLATE_STRING,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
NUMBER,
{ // object attr container
begin: /[{,]\s*/, relevance: 0,
contains: [
hljs.BACKSLASH_ESCAPE,
{
className: 'subst',
begin: '\\$\\{', end: '\\}'
begin: IDENT_RE + '\\s*:', returnBegin: true,
relevance: 0,
contains: [{className: 'attr', begin: IDENT_RE, relevance: 0}]
}
]
},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'number',
variants: [
{ begin: '\\b(0[bB][01]+)' },
{ begin: '\\b(0[oO][0-7]+)' },
{ begin: hljs.C_NUMBER_RE }
],
relevance: 0
},
{ // "value" container

@@ -66,2 +96,26 @@ begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',

hljs.REGEXP_MODE,
{
className: 'function',
begin: '(\\(.*?\\)|' + IDENT_RE + ')\\s*=>', returnBegin: true,
end: '\\s*=>',
contains: [
{
className: 'params',
variants: [
{
begin: IDENT_RE
},
{
begin: /\(\s*\)/,
},
{
begin: /\(/, end: /\)/,
excludeBegin: true, excludeEnd: true,
keywords: KEYWORDS,
contains: PARAMS_CONTAINS
}
]
}
]
},
{ // E4X / JSX

@@ -72,3 +126,9 @@ begin: /</, end: /(\/\w+|\w+\/)>/,

{begin: /<\w+\s*\/>/, skip: true},
{begin: /<\w+/, end: /(\/\w+|\w+\/)>/, skip: true, contains: ['self']}
{
begin: /<\w+/, end: /(\/\w+|\w+\/)>/, skip: true,
contains: [
{begin: /<\w+\s*\/>/, skip: true},
'self'
]
}
]

@@ -83,3 +143,3 @@ }

contains: [
hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][0-9A-Za-z$_]*/}),
hljs.inherit(hljs.TITLE_MODE, {begin: IDENT_RE}),
{

@@ -90,6 +150,3 @@ className: 'params',

excludeEnd: true,
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
contains: PARAMS_CONTAINS
}

@@ -96,0 +153,0 @@ ],

@@ -102,4 +102,3 @@ module.exports = function(hljs) {

}, {
begin: INTERP_IDENT_RE + '[^;]*{',
end: '{'
begin: INTERP_IDENT_RE, end: '{'
}],

@@ -109,2 +108,3 @@ returnBegin: true,

illegal: '[<=\'$"]',
relevance: 0,
contains: [

@@ -111,0 +111,0 @@ hljs.C_LINE_COMMENT_MODE,

@@ -60,2 +60,5 @@ module.exports = function(hljs) {

begin: /\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/
},
{
begin: /<<(-?)\w+$/, end: /^\s*\w+$/,
}

@@ -62,0 +65,0 @@ ]

module.exports = function(hljs) {
var NUM_SUFFIX = '([uif](8|16|32|64|size))\?';
var BLOCK_COMMENT = hljs.inherit(hljs.C_BLOCK_COMMENT_MODE);
BLOCK_COMMENT.contains.push('self');
var KEYWORDS =

@@ -40,3 +38,3 @@ 'alignof as be box break const continue crate do else enum extern ' +

hljs.C_LINE_COMMENT_MODE,
BLOCK_COMMENT,
hljs.COMMENT('/\\*', '\\*/', {contains: ['self']}),
hljs.inherit(hljs.QUOTE_STRING_MODE, {begin: /b?"/, illegal: null}),

@@ -43,0 +41,0 @@ {

@@ -18,4 +18,4 @@ module.exports = function(hljs) {

keyword:
'abs access after alias all and architecture array assert attribute begin block ' +
'body buffer bus case component configuration constant context cover disconnect ' +
'abs access after alias all and architecture array assert assume assume_guarantee attribute ' +
'begin block body buffer bus case component configuration constant context cover disconnect ' +
'downto default else elsif end entity exit fairness file for force function generate ' +

@@ -29,10 +29,15 @@ 'generic group guarded if impure in inertial inout is label library linkage literal ' +

built_in:
'boolean bit character severity_level integer time delay_length natural positive ' +
'string bit_vector file_open_kind file_open_status std_ulogic std_ulogic_vector ' +
'boolean bit character ' +
'integer time delay_length natural positive ' +
'string bit_vector file_open_kind file_open_status ' +
'std_logic std_logic_vector unsigned signed boolean_vector integer_vector ' +
'real_vector time_vector'
'std_ulogic std_ulogic_vector unresolved_unsigned u_unsigned unresolved_signed u_signed' +
'real_vector time_vector',
literal:
'false true note warning error failure ' + // severity_level
'line text side width' // textio
},
illegal: '{',
contains: [
hljs.C_BLOCK_COMMENT_MODE, // VHDL-2008 block commenting.
hljs.C_BLOCK_COMMENT_MODE, // VHDL-2008 block commenting.
hljs.COMMENT('--', '$'),

@@ -46,3 +51,3 @@ hljs.QUOTE_STRING_MODE,

{
className: 'literal',
className: 'string',
begin: '\'(U|X|0|1|Z|W|L|H|-)\'',

@@ -49,0 +54,0 @@ contains: [hljs.BACKSLASH_ESCAPE]

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

"homepage": "https://highlightjs.org/",
"version": "9.6.0",
"version": "9.7.0",
"author": {

@@ -12,0 +12,0 @@ "name": "Ivan Sagalaev",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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