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.11.0 to 9.12.0

lib/languages/julia-repl.js

2

lib/index.js

@@ -89,2 +89,3 @@ var hljs = require('./highlight');

hljs.registerLanguage('julia', require('./languages/julia'));
hljs.registerLanguage('julia-repl', require('./languages/julia-repl'));
hljs.registerLanguage('kotlin', require('./languages/kotlin'));

@@ -139,2 +140,3 @@ hljs.registerLanguage('lasso', require('./languages/lasso'));

hljs.registerLanguage('roboconf', require('./languages/roboconf'));
hljs.registerLanguage('routeros', require('./languages/routeros'));
hljs.registerLanguage('rsl', require('./languages/rsl'));

@@ -141,0 +143,0 @@ hljs.registerLanguage('ruleslanguage', require('./languages/ruleslanguage'));

23

lib/languages/autohotkey.js
module.exports = function(hljs) {
var BACKTICK_ESCAPE = {
begin: /`[\s\S]/
begin: '`[\\s\\S]'
};

@@ -8,4 +8,5 @@

case_insensitive: true,
aliases: [ 'ahk' ],
keywords: {
keyword: 'Break Continue Else Gosub If Loop Return While',
keyword: 'Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group',
literal: 'A|0 true false NOT AND OR',

@@ -22,2 +23,3 @@ built_in: 'ComSpec Clipboard ClipboardAll ErrorLevel',

hljs.COMMENT(';', '$', {relevance: 0}),
hljs.C_BLOCK_COMMENT_MODE,
{

@@ -29,8 +31,17 @@ className: 'number',

{
className: 'variable', // FIXME
begin: '%', end: '%',
illegal: '\\n',
contains: [BACKTICK_ESCAPE]
className: 'subst', // FIXED
begin: '%(?=[a-zA-Z0-9#_$@])', end: '%',
illegal: '[^a-zA-Z0-9#_$@]'
},
{
className: 'built_in',
begin: '^\\s*\\w+\\s*,'
//I don't really know if this is totally relevant
},
{
className: 'meta',
begin: '^\\s*#\w+', end:'$',
relevance: 0
},
{
className: 'symbol',

@@ -37,0 +48,0 @@ contains: [BACKTICK_ESCAPE],

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

aliases: ['sh', 'zsh'],
lexemes: /-?[a-z\._]+/,
lexemes: /\b-?[a-z\._]+\b/,
keywords: {

@@ -32,0 +32,0 @@ keyword:

@@ -88,2 +88,3 @@ module.exports = function(hljs) {

COLLECTION.contains = DEFAULT_CONTAINS;
HINT_COL.contains = [COLLECTION];

@@ -90,0 +91,0 @@ return {

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

keyword:
'abstract alias as asm begin break case class def do else elsif end ensure enum extend for fun if ifdef ' +
'include instance_sizeof is_a? lib macro module next of out pointerof private protected rescue responds_to? ' +
'return require self sizeof struct super then type typeof union unless until when while with yield ' +
'__DIR__ __FILE__ __LINE__',
'abstract alias as as? asm begin break case class def do else elsif end ensure enum extend for fun if ' +
'include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? ' +
'return require select self sizeof struct super then type typeof union uninitialized unless until when while with yield ' +
'__DIR__ __END_LINE__ __FILE__ __LINE__',
literal: 'false nil true'

@@ -51,5 +51,21 @@ };

{begin: '%w?\\|', end: '\\|'},
{begin: /<<-\w+$/, end: /^\s*\w+$/},
],
relevance: 0,
};
var Q_STRING = {
className: 'string',
variants: [
{begin: '%q\\(', end: '\\)', contains: recursiveParen('\\(', '\\)')},
{begin: '%q\\[', end: '\\]', contains: recursiveParen('\\[', '\\]')},
{begin: '%q{', end: '}', contains: recursiveParen('{', '}')},
{begin: '%q<', end: '>', contains: recursiveParen('<', '>')},
{begin: '%q/', end: '/'},
{begin: '%q%', end: '%'},
{begin: '%q-', end: '-'},
{begin: '%q\\|', end: '\\|'},
{begin: /<<-'\w+'$/, end: /^\s*\w+$/},
],
relevance: 0,
};
var REGEXP = {

@@ -102,2 +118,3 @@ begin: '(' + RE_STARTER + ')\\s*',

STRING,
Q_STRING,
REGEXP,

@@ -104,0 +121,0 @@ REGEXP2,

@@ -6,8 +6,7 @@ module.exports = function(hljs) {

'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 ' +
'default delegate do double enum event explicit extern finally fixed float ' +
'for foreach goto if implicit in int interface internal is lock long nameof ' +
'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 void volatile while ' +
'nameof ' +
// Contextual keywords.

@@ -76,2 +75,3 @@ 'add alias ascending async await by descending dynamic equals from get global group into join ' +

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

@@ -110,3 +110,5 @@ aliases: ['csharp'],

begin: '#', end: '$',
keywords: {'meta-keyword': 'if else elif endif define undef warning error line region endregion pragma checksum'}
keywords: {
'meta-keyword': 'if else elif endif define undef warning error line region endregion pragma checksum'
}
},

@@ -134,5 +136,13 @@ STRING,

{
// [Attributes("")]
className: 'meta',
begin: '^\\s*\\[', excludeBegin: true, end: '\\]', excludeEnd: true,
contains: [
{className: 'meta-string', begin: /"/, end: /"/}
]
},
{
// Expression keywords prevent 'keyword Name(...)' from being
// recognized as a function definition
beginKeywords: 'new return throw await',
beginKeywords: 'new return throw await else',
relevance: 0

@@ -142,4 +152,4 @@ },

className: 'function',
begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*\\(', returnBegin: true, end: /[{;=]/,
excludeEnd: true,
begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*\\(', returnBegin: true,
end: /[{;=]/, excludeEnd: true,
keywords: KEYWORDS,

@@ -146,0 +156,0 @@ contains: [

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

className: 'title',
begin: /^[a-z][a-z0-9_]+/,
begin: /^[a-z0-9_]+/,
},

@@ -146,0 +146,0 @@ PARAMS,

module.exports = function(hljs) {
// Since there are numerous special names in Julia, it is too much trouble
// to maintain them by hand. Hence these names (i.e. keywords, literals and
// built-ins) are automatically generated from Julia (v0.3.0 and v0.4.1)
// itself through following scripts for each.
// built-ins) are automatically generated from Julia v0.6 itself through
// the following scripts for each.
var KEYWORDS = {
// # keyword generator
// println("in")
// # keyword generator, multi-word keywords handled manually below
// foreach(println, ["in", "isa", "where"])
// for kw in Base.REPLCompletions.complete_keyword("")
// println(kw)
// if !(contains(kw, " ") || kw == "struct")
// println(kw)
// end
// end
keyword:
'in abstract baremodule begin bitstype break catch ccall const continue do else elseif end export ' +
'finally for function global if immutable import importall let local macro module quote return try type ' +
'typealias using while',
'in isa where ' +
'baremodule begin break catch ccall const continue do else elseif end export false finally for function ' +
'global if import importall let local macro module quote return true try using while ' +
// legacy, to be deprecated in the next release
'type immutable abstract bitstype typealias ',

@@ -23,13 +27,4 @@ // # literal generator

// try
// s = symbol(name)
// v = eval(s)
// if !isa(v, Function) &&
// !isa(v, DataType) &&
// !isa(v, IntrinsicFunction) &&
// !issubtype(typeof(v), Tuple) &&
// !isa(v, Union) &&
// !isa(v, Module) &&
// !isa(v, TypeConstructor) &&
// !isa(v, TypeVar) &&
// !isa(v, Colon)
// v = eval(Symbol(name))
// if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)
// println(name)

@@ -40,10 +35,7 @@ // end

literal:
// v0.3
'true false ARGS CPU_CORES C_NULL DL_LOAD_PATH DevNull ENDIAN_BOM ENV I|0 Inf Inf16 Inf32 ' +
'InsertionSort JULIA_HOME LOAD_PATH MS_ASYNC MS_INVALIDATE MS_SYNC MergeSort NaN NaN16 NaN32 OS_NAME QuickSort ' +
'RTLD_DEEPBIND RTLD_FIRST RTLD_GLOBAL RTLD_LAZY RTLD_LOCAL RTLD_NODELETE RTLD_NOLOAD RTLD_NOW RoundDown ' +
'RoundFromZero RoundNearest RoundToZero RoundUp STDERR STDIN STDOUT VERSION WORD_SIZE catalan cglobal e|0 eu|0 ' +
'eulergamma golden im nothing pi γ π φ ' +
// v0.4 (diff)
'Inf64 NaN64 RoundNearestTiesAway RoundNearestTiesUp ',
'true false ' +
'ARGS C_NULL DevNull ENDIAN_BOM ENV I Inf Inf16 Inf32 Inf64 InsertionSort JULIA_HOME LOAD_PATH MergeSort ' +
'NaN NaN16 NaN32 NaN64 PROGRAM_FILE QuickSort RoundDown RoundFromZero RoundNearest RoundNearestTiesAway ' +
'RoundNearestTiesUp RoundToZero RoundUp STDERR STDIN STDOUT VERSION catalan e|0 eu|0 eulergamma golden im ' +
'nothing pi γ π φ ',

@@ -53,4 +45,4 @@ // # built_in generator:

// try
// v = eval(symbol(name))
// if isa(v, DataType) || isa(v, TypeConstructor) || isa(v, TypeVar)
// v = eval(Symbol(name))
// if v isa Type || v isa TypeVar
// println(name)

@@ -61,30 +53,26 @@ // end

built_in:
// v0.3
'ANY ASCIIString AbstractArray AbstractRNG AbstractSparseArray Any ArgumentError Array Associative Base64Pipe ' +
'Bidiagonal BigFloat BigInt BitArray BitMatrix BitVector Bool BoundsError Box CFILE Cchar Cdouble Cfloat Char ' +
'CharString Cint Clong Clonglong ClusterManager Cmd Coff_t Colon Complex Complex128 Complex32 Complex64 ' +
'Condition Cptrdiff_t Cshort Csize_t Cssize_t Cuchar Cuint Culong Culonglong Cushort Cwchar_t DArray DataType ' +
'DenseArray Diagonal Dict DimensionMismatch DirectIndexString Display DivideError DomainError EOFError ' +
'EachLine Enumerate ErrorException Exception Expr Factorization FileMonitor FileOffset Filter Float16 Float32 ' +
'Float64 FloatRange FloatingPoint Function GetfieldNode GotoNode Hermitian IO IOBuffer IOStream IPv4 IPv6 ' +
'InexactError Int Int128 Int16 Int32 Int64 Int8 IntSet Integer InterruptException IntrinsicFunction KeyError ' +
'LabelNode LambdaStaticData LineNumberNode LoadError LocalProcess MIME MathConst MemoryError MersenneTwister ' +
'Method MethodError MethodTable Module NTuple NewvarNode Nothing Number ObjectIdDict OrdinalRange ' +
'OverflowError ParseError PollingFileWatcher ProcessExitedException ProcessGroup Ptr QuoteNode Range Range1 ' +
'Ranges Rational RawFD Real Regex RegexMatch RemoteRef RepString RevString RopeString RoundingMode Set ' +
'SharedArray Signed SparseMatrixCSC StackOverflowError Stat StatStruct StepRange String SubArray SubString ' +
'SymTridiagonal Symbol SymbolNode Symmetric SystemError Task TextDisplay Timer TmStruct TopNode Triangular ' +
'Tridiagonal Type TypeConstructor TypeError TypeName TypeVar UTF16String UTF32String UTF8String UdpSocket ' +
'Uint Uint128 Uint16 Uint32 Uint64 Uint8 UndefRefError UndefVarError UniformScaling UnionType UnitRange ' +
'Unsigned Vararg VersionNumber WString WeakKeyDict WeakRef Woodbury Zip ' +
// v0.4 (diff)
'AbstractChannel AbstractFloat AbstractString AssertionError Base64DecodePipe Base64EncodePipe BufferStream ' +
'CapturedException CartesianIndex CartesianRange Channel Cintmax_t CompositeException Cstring Cuintmax_t ' +
'Cwstring Date DateTime Dims Enum GenSym GlobalRef HTML InitError InvalidStateException Irrational LinSpace ' +
'LowerTriangular NullException Nullable OutOfMemoryError Pair PartialQuickSort Pipe RandomDevice ' +
'ReadOnlyMemoryError ReentrantLock Ref RemoteException SegmentationFault SerializationState SimpleVector ' +
'TCPSocket Text Tuple UDPSocket UInt UInt128 UInt16 UInt32 UInt64 UInt8 UnicodeError Union UpperTriangular ' +
'Val Void WorkerConfig AbstractMatrix AbstractSparseMatrix AbstractSparseVector AbstractVecOrMat AbstractVector ' +
'DenseMatrix DenseVecOrMat DenseVector Matrix SharedMatrix SharedVector StridedArray StridedMatrix ' +
'StridedVecOrMat StridedVector VecOrMat Vector '
'ANY AbstractArray AbstractChannel AbstractFloat AbstractMatrix AbstractRNG AbstractSerializer AbstractSet ' +
'AbstractSparseArray AbstractSparseMatrix AbstractSparseVector AbstractString AbstractUnitRange AbstractVecOrMat ' +
'AbstractVector Any ArgumentError Array AssertionError Associative Base64DecodePipe Base64EncodePipe Bidiagonal '+
'BigFloat BigInt BitArray BitMatrix BitVector Bool BoundsError BufferStream CachingPool CapturedException ' +
'CartesianIndex CartesianRange Cchar Cdouble Cfloat Channel Char Cint Cintmax_t Clong Clonglong ClusterManager ' +
'Cmd CodeInfo Colon Complex Complex128 Complex32 Complex64 CompositeException Condition ConjArray ConjMatrix ' +
'ConjVector Cptrdiff_t Cshort Csize_t Cssize_t Cstring Cuchar Cuint Cuintmax_t Culong Culonglong Cushort Cwchar_t ' +
'Cwstring DataType Date DateFormat DateTime DenseArray DenseMatrix DenseVecOrMat DenseVector Diagonal Dict ' +
'DimensionMismatch Dims DirectIndexString Display DivideError DomainError EOFError EachLine Enum Enumerate ' +
'ErrorException Exception ExponentialBackOff Expr Factorization FileMonitor Float16 Float32 Float64 Function ' +
'Future GlobalRef GotoNode HTML Hermitian IO IOBuffer IOContext IOStream IPAddr IPv4 IPv6 IndexCartesian IndexLinear ' +
'IndexStyle InexactError InitError Int Int128 Int16 Int32 Int64 Int8 IntSet Integer InterruptException ' +
'InvalidStateException Irrational KeyError LabelNode LinSpace LineNumberNode LoadError LowerTriangular MIME Matrix ' +
'MersenneTwister Method MethodError MethodTable Module NTuple NewvarNode NullException Nullable Number ObjectIdDict ' +
'OrdinalRange OutOfMemoryError OverflowError Pair ParseError PartialQuickSort PermutedDimsArray Pipe ' +
'PollingFileWatcher ProcessExitedException Ptr QuoteNode RandomDevice Range RangeIndex Rational RawFD ' +
'ReadOnlyMemoryError Real ReentrantLock Ref Regex RegexMatch RemoteChannel RemoteException RevString RoundingMode ' +
'RowVector SSAValue SegmentationFault SerializationState Set SharedArray SharedMatrix SharedVector Signed ' +
'SimpleVector Slot SlotNumber SparseMatrixCSC SparseVector StackFrame StackOverflowError StackTrace StepRange ' +
'StepRangeLen StridedArray StridedMatrix StridedVecOrMat StridedVector String SubArray SubString SymTridiagonal ' +
'Symbol Symmetric SystemError TCPSocket Task Text TextDisplay Timer Tridiagonal Tuple Type TypeError TypeMapEntry ' +
'TypeMapLevel TypeName TypeVar TypedSlot UDPSocket UInt UInt128 UInt16 UInt32 UInt64 UInt8 UndefRefError UndefVarError ' +
'UnicodeError UniformScaling Union UnionAll UnitRange Unsigned UpperTriangular Val Vararg VecElement VecOrMat Vector ' +
'VersionNumber Void WeakKeyDict WeakRef WorkerConfig WorkerPool '
};

@@ -96,14 +84,6 @@

// placeholder for recursive self-reference
var DEFAULT = { lexemes: VARIABLE_NAME_RE, keywords: KEYWORDS, illegal: /<\// };
var TYPE_ANNOTATION = {
className: 'type',
begin: /::/
var DEFAULT = {
lexemes: VARIABLE_NAME_RE, keywords: KEYWORDS, illegal: /<\//
};
var SUBTYPE = {
className: 'type',
begin: /<:/
};
// ref: http://julia.readthedocs.org/en/latest/manual/integers-and-floating-point-numbers/

@@ -171,4 +151,2 @@ var NUMBER = {

CHAR,
TYPE_ANNOTATION,
SUBTYPE,
STRING,

@@ -178,3 +156,9 @@ COMMAND,

COMMENT,
hljs.HASH_COMMENT_MODE
hljs.HASH_COMMENT_MODE,
{
className: 'keyword',
begin:
'\\b(((abstract|primitive)\\s+)type|(mutable\\s+)?struct)\\b'
},
{begin: /<:/} // relevance booster
];

@@ -181,0 +165,0 @@ INTERPOLATION.contains = DEFAULT.contains;

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

className: 'subst',
variants: [
{begin: '\\$' + hljs.UNDERSCORE_IDENT_RE},
{begin: '\\${', end: '}', contains: [hljs.APOS_STRING_MODE, hljs.C_NUMBER_MODE]}
]
begin: '\\${', end: '}', contains: [hljs.APOS_STRING_MODE, hljs.C_NUMBER_MODE]
};
var VARIABLE = {
className: 'variable', begin: '\\$' + hljs.UNDERSCORE_IDENT_RE
};
var STRING = {

@@ -45,3 +45,3 @@ className: 'string',

begin: '"""', end: '"""',
contains: [SUBST]
contains: [VARIABLE, SUBST]
},

@@ -59,3 +59,3 @@ // Can't use built-in modes easily, as we want to use STRING in the meta

illegal: /\n/,
contains: [hljs.BACKSLASH_ESCAPE, SUBST]
contains: [hljs.BACKSLASH_ESCAPE, VARIABLE, SUBST]
}

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

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

'geoshape int list matrix4x4 parent point quaternion real rect ' +
'size string url var variant vector2d vector3d vector4d' +
'size string url variant vector2d vector3d vector4d' +
'Promise'

@@ -22,0 +22,0 @@ };

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

variants: [
{ begin: /r(#*)".*?"\1(?!#)/ },
{ begin: /r(#*)"(.|\n)*?"\1(?!#)/ },
{ begin: /b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/ }

@@ -50,0 +50,0 @@ ]

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

'break case catch class continue convenience default defer deinit didSet do ' +
'dynamic dynamicType else enum extension fallthrough false final for func ' +
'dynamic dynamicType else enum extension fallthrough false fileprivate final for func ' +
'get guard if import in indirect infix init inout internal is lazy left let ' +
'mutating nil none nonmutating operator optional override postfix precedence ' +
'mutating nil none nonmutating open operator optional override postfix precedence ' +
'prefix private protocol Protocol public repeat required rethrows return ' +

@@ -10,0 +10,0 @@ 'right self Self set static struct subscript super switch throw throws true ' +

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

"homepage": "https://highlightjs.org/",
"version": "9.11.0",
"version": "9.12.0",
"author": {

@@ -971,2 +971,26 @@ "name": "Ivan Sagalaev",

"email": "joel@porquet.org"
},
{
"name": "Alex Arslan",
"email": "ararslan@comcast.net"
},
{
"name": "Stanislav Belov",
"email": "stbelov@gmail.com"
},
{
"name": "Ivan Dementev",
"email": "ivan_div@mail.ru"
},
{
"name": "Nicolas LLOBERA",
"email": "nllobera@gmail.com"
},
{
"name": "Morten Piibeleht",
"email": "morten.piibeleht@gmail.com"
},
{
"name": "Martin Clausen",
"email": "martin.clausene@gmail.com"
}

@@ -973,0 +997,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