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 8.7.0 to 8.8.0

lib/languages/accesslog.js

12

lib/highlight.js

@@ -43,3 +43,3 @@ /*

function isNotHighlighted(language) {
return /no-?highlight|plain|text/.test(language);
return (/^(no-?highlight|plain|text)$/i).test(language);
}

@@ -53,4 +53,4 @@

// language-* takes precedence over non-prefixed class names and
match = /\blang(?:uage)?-([\w-]+)\b/.exec(classes);
// language-* takes precedence over non-prefixed class names
match = (/\blang(?:uage)?-([\w-]+)\b/i).exec(classes);
if (match) {

@@ -61,8 +61,7 @@ return getLanguage(match[1]) ? match[1] : 'no-highlight';

classes = classes.split(/\s+/);
for(i = 0, length = classes.length; i < length; i++) {
if(getLanguage(classes[i]) || isNotHighlighted(classes[i])) {
for (i = 0, length = classes.length; i < length; i++) {
if (getLanguage(classes[i]) || isNotHighlighted(classes[i])) {
return classes[i];
}
}
}

@@ -657,2 +656,3 @@

function getLanguage(name) {
name = name.toLowerCase();
return languages[name] || languages[aliases[name]];

@@ -659,0 +659,0 @@ }

var hljs = require('./highlight');
hljs.registerLanguage('1c', require('./languages/1c'));
hljs.registerLanguage('accesslog', require('./languages/accesslog'));
hljs.registerLanguage('actionscript', require('./languages/actionscript'));

@@ -25,2 +26,3 @@ hljs.registerLanguage('apache', require('./languages/apache'));

hljs.registerLanguage('cpp', require('./languages/cpp'));
hljs.registerLanguage('crystal', require('./languages/crystal'));
hljs.registerLanguage('cs', require('./languages/cs'));

@@ -47,2 +49,3 @@ hljs.registerLanguage('css', require('./languages/css'));

hljs.registerLanguage('fsharp', require('./languages/fsharp'));
hljs.registerLanguage('gams', require('./languages/gams'));
hljs.registerLanguage('gcode', require('./languages/gcode'));

@@ -52,2 +55,3 @@ hljs.registerLanguage('gherkin', require('./languages/gherkin'));

hljs.registerLanguage('go', require('./languages/go'));
hljs.registerLanguage('golo', require('./languages/golo'));
hljs.registerLanguage('gradle', require('./languages/gradle'));

@@ -62,2 +66,3 @@ hljs.registerLanguage('groovy', require('./languages/groovy'));

hljs.registerLanguage('ini', require('./languages/ini'));
hljs.registerLanguage('irpf90', require('./languages/irpf90'));
hljs.registerLanguage('java', require('./languages/java'));

@@ -64,0 +69,0 @@ hljs.registerLanguage('javascript', require('./languages/javascript'));

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

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

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

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

// Clojure keywords
'def cond apply if-not if-let if not not= = < > <= >= == + / * - rem '+
'def defonce cond apply if-not if-let if not not= = < > <= >= == + / * - rem '+
'quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? '+

@@ -8,0 +8,0 @@ 'set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? '+

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

var PREPROCESSOR = {
className: 'preprocessor',
begin: '#', end: '$',
keywords: 'if else elif endif define undef warning error line ' +
'pragma ifdef ifndef',
contains: [
{
begin: /\\\n/, relevance: 0
},
{
beginKeywords: 'include', end: '$',
contains: [
STRINGS,
{
className: 'string',
begin: '<', end: '>',
illegal: '\\n',
}
]
},
STRINGS,
NUMBERS,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
};
var FUNCTION_TITLE = hljs.IDENT_RE + '\\s*\\(';

@@ -55,2 +82,3 @@

};
return {

@@ -66,29 +94,4 @@ aliases: ['c', 'cc', 'h', 'c++', 'h++', 'hpp'],

STRINGS,
PREPROCESSOR,
{
className: 'preprocessor',
begin: '#', end: '$',
keywords: 'if else elif endif define undef warning error line ' +
'pragma ifdef ifndef',
contains: [
{
begin: /\\\n/, relevance: 0
},
{
beginKeywords: 'include', end: '$',
contains: [
STRINGS,
{
className: 'string',
begin: '<', end: '>',
illegal: '\\n',
}
]
},
STRINGS,
NUMBERS,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
]
},
{
begin: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<', end: '>',

@@ -114,2 +117,3 @@ keywords: CPP_KEYWORDS,

keywords: CPP_KEYWORDS,
illegal: /[^\w\s\*&]/,
contains: [

@@ -134,3 +138,4 @@ {

hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
hljs.C_BLOCK_COMMENT_MODE,
PREPROCESSOR
]

@@ -137,0 +142,0 @@ }

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

contains: [
{className: 'type', begin: '\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?'},
hljs.inherit(hljs.TITLE_MODE, {begin: '[_a-z][\\w\']*'})
{className: 'type', begin: '\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?'}
].concat(COMMENT_MODES)

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

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

'numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ' +
'ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous ' +
'ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive ' +
'pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure',

@@ -55,3 +55,3 @@ built_in: 'alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint ' +

hljs.inherit(hljs.APOS_STRING_MODE, {className: 'string', relevance: 0}),
hljs.inherit(hljs.QUOTE_STRING_MODE,{className: 'string', relevance: 0}),
hljs.inherit(hljs.QUOTE_STRING_MODE, {className: 'string', relevance: 0}),
{

@@ -58,0 +58,0 @@ className: 'function',

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

keywords:
// monad builder keywords (at top, matches before non-bang kws)
'yield! return! let! do!' +
// regular keywords
'abstract and as assert base begin class default delegate do done ' +

@@ -24,2 +21,7 @@ 'downcast downto elif else end exception extern false finally for ' +

{
// monad builder keywords (matches before non-bang kws)
className: 'keyword',
begin: /\b(yield|return|let|do)!/
},
{
className: 'string',

@@ -26,0 +28,0 @@ begin: '@"', end: '"',

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

// kind:
'thing|10 room|10 person|10 man|10 woman|10 animal|10 container ' +
'supporter|10 backdrop|10 door|10 ' +
'thing room person man woman animal container ' +
'supporter backdrop door ' +
// characteristic:
'scenery|10 open closed|10 locked|10 inside|10 gender|10 ' +
'scenery open closed locked inside gender ' +
// verb:
'is are say|10 understand|10 ' +
'is are say understand ' +
// misc keyword:
'kind|10 of rule|10'
'kind of rule'
},

@@ -35,17 +35,9 @@ contains: [

className: 'title',
beginKeywords: '^Volume ^Book ^Part ^Chapter ^Section',
end: '$',
relevance: 10
begin: /^(Volume|Book|Part|Chapter|Section|Table)\b/,
end: '$'
},
{
// Table
className: 'title',
beginKeywords: '^Table',
end: '$',
relevance: 10
},
{
// Rule definition
// This is here for relevance.
begin: '^\\b(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)',
begin: /^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,
end: ':',

@@ -56,7 +48,5 @@ contains: [

begin: '\\b\\(This',
end: '\\)',
relevance: 10
end: '\\)'
}
],
relevance: 10
]
},

@@ -63,0 +53,0 @@ {

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

hljs.C_BLOCK_COMMENT_MODE
],
illegal: /["'\(]/
]
}

@@ -83,0 +82,0 @@ ],

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

'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 eu ' +
'RoundFromZero RoundNearest RoundToZero RoundUp STDERR STDIN STDOUT VERSION WORD_SIZE catalan cglobal e|0 eu|0 ' +
'eulergamma golden im nothing pi γ π φ',

@@ -42,0 +42,0 @@

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

keywords: {
keyword: 'addr and as asm bind block break|0 case|0 cast const|0 continue|0 converter discard distinct|10 div do elif else|0 end|0 enum|0 except export finally for from generic if|0 import|0 in include|0 interface is isnot|10 iterator|10 let|0 macro method|10 mixin mod nil not notin|10 object|0 of or out proc|10 ptr raise ref|10 return shl shr static template|10 try|0 tuple type|0 using|0 var|0 when while|0 with without xor yield',
keyword: 'addr and as asm bind block break|0 case|0 cast const|0 continue|0 converter discard distinct|10 div do elif else|0 end|0 enum|0 except export finally for from generic if|0 import|0 in include|0 interface is isnot|10 iterator|10 let|0 macro method|10 mixin mod nil not notin|10 object|0 of or out proc|10 ptr raise ref|10 return shl shr static template try|0 tuple type|0 using|0 var|0 when while|0 with without xor yield',
literal: 'shared guarded stdin stdout stderr result|10 true false'

@@ -8,0 +8,0 @@ },

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

className: 'literal',
begin: '\\[(\\|\\|)?\\]|\\(\\)'
begin: '\\[(\\|\\|)?\\]|\\(\\)',
relevance: 0
},

@@ -30,0 +31,0 @@ hljs.COMMENT(

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

STRING,
PARAMS,
SPECIAL_VARS,

@@ -55,0 +54,0 @@ MODIFIERS,

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

literal:
'all any no-route self urpf-failed egress|5 unknown',
'all any no-route self urpf-failed egress|5 unknown'
},

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

MACRO,
TABLE,
TABLE
]
};
};

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

className: 'string',
begin: '<<<[\'"]?\\w+[\'"]?$', end: '^\\w+;',
contains: [hljs.BACKSLASH_ESCAPE]
begin: /<<<['"]?\w+['"]?$/, end: /^\w+;?$/,
contains: [
hljs.BACKSLASH_ESCAPE,
{
className: 'subst',
variants: [
{begin: /\$\w+/},
{begin: /\{\$/, end: /\}/}
]
}
]
},

@@ -66,0 +75,0 @@ PREPROCESSOR,

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

};
var dollarEscape = {
begin: '\\$\\$[\\s\\S]',
relevance: 0
};
var VAR = {

@@ -12,0 +8,0 @@ className: 'variable',

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

'exec else break not with class assert yield try while continue del or def lambda ' +
'nonlocal|10 None True False',
'async await nonlocal|10 None True False',
built_in:

@@ -59,0 +59,0 @@ 'Ellipsis NotImplemented'

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

beginKeywords: 'def', end: '$|;',
relevance: 0,
contains: [

@@ -91,0 +90,0 @@ hljs.inherit(hljs.TITLE_MODE, {begin: RUBY_METHOD_RE}),

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

built_in:
// prelude
'Copy Send Sized Sync Drop Fn FnMut FnOnce drop Box ToOwned Clone ' +
'PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator ' +
'Extend IntoIterator DoubleEndedIterator ExactSizeIterator Option ' +
'Some None Result Ok Err SliceConcatExt String ToString Vec ' +
// macros
'assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! ' +

@@ -20,0 +26,0 @@ 'debug_assert! debug_assert_eq! env! panic! file! format! format_args! ' +

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

case_insensitive: true,
illegal: /[<>]/,
illegal: /[<>{}*]/,
contains: [

@@ -13,3 +13,3 @@ {

'delete do handler insert load replace select truncate update set show pragma grant ' +
'merge describe use explain help declare prepare execute deallocate savepoint release|0 ' +
'merge describe use explain help declare prepare execute deallocate release ' +
'unlock purge reset change stop analyze cache flush optimize repair kill ' +

@@ -66,7 +66,7 @@ 'install uninstall checksum restore check backup revoke',

'is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists ' +
'k keep keep_duplicates key keys kill l language large last|0 last_day last_insert_id last_value lax lcase ' +
'k keep keep_duplicates key keys kill l language large last last_day last_insert_id last_value lax lcase ' +
'lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit ' +
'lines link|0 list|0 listagg little ln load load_file lob lobs local localtime localtimestamp locate ' +
'locator lock|0 locked log log10 log2 logfile logfiles logging logical logical_reads_per_call ' +
'logoff logon logs long loop|0 low low_priority lower lpad lrtrim ltrim m main make_set makedate maketime ' +
'lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate ' +
'locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call ' +
'logoff logon logs long loop low low_priority lower lpad lrtrim ltrim m main make_set makedate maketime ' +
'managed management manual map mapping mask master master_pos_wait match matched materialized max ' +

@@ -95,6 +95,6 @@ 'maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans ' +

'profiles project prompt protection public publishingservername purge quarter query quick quiesce quota ' +
'quotename radians raise|0 rand range rank raw read reads readsize rebuild record records ' +
'quotename radians raise rand range rank raw read reads readsize rebuild record records ' +
'recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh ' +
'regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy ' +
'reject rekey relational relative relaylog release|0 release_lock relies_on relocate rely rem remainder ' +
'reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename ' +
'repair repeat replace replicate replication required reset resetlogs resize resource respect restore ' +

@@ -104,3 +104,3 @@ 'restricted result result_cache resumable resume retention return returning returns reuse reverse revoke ' +

'rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll ' +
'sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment ' +
'sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select ' +
'self sequence sequential serializable server servererror session session_user sessions_per_user set ' +

@@ -107,0 +107,0 @@ 'sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor ' +

module.exports = function(hljs) {
var SWIFT_KEYWORDS = {
keyword: 'class deinit enum extension func import init let protocol static ' +
keyword: 'class deinit enum extension func init let protocol static ' +
'struct subscript typealias var break case continue default do ' +

@@ -107,2 +107,6 @@ 'else fallthrough if in for return switch where while as dynamicType ' +

'@infix|@prefix|@postfix)'
},
{
beginKeywords: 'import', end: /$/,
contains: [hljs.C_LINE_COMMENT_MODE, BLOCK_COMMENT]
}

@@ -109,0 +113,0 @@ ]

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

relevance: 0
}
};
var TPLABEL = {
className: 'comment',
begin: ':[^\\]]+'
}
};
var TPDATA = {

@@ -43,3 +43,3 @@ className: 'built_in',

constant:
'ON OFF max_speed LPOS JPOS ENABLE DISABLE START STOP RESET',
'ON OFF max_speed LPOS JPOS ENABLE DISABLE START STOP RESET'
},

@@ -46,0 +46,0 @@ contains: [

module.exports = function(hljs) {
var BUILTIN_MODULES = 'ObjectLoader Animate MovieCredits Slides Filters Shading Materials LensFlare Mapping VLCAudioVideo StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts';
var BUILTIN_MODULES =
'ObjectLoader Animate MovieCredits Slides Filters Shading Materials LensFlare Mapping VLCAudioVideo ' +
'StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts';

@@ -10,3 +12,8 @@ var XL_KEYWORDS = {

module: BUILTIN_MODULES,
id: 'text_length text_range text_find text_replace contains page slide basic_slide title_slide title subtitle fade_in fade_out fade_at clear_color color line_color line_width texture_wrap texture_transform texture scale_?x scale_?y scale_?z? translate_?x translate_?y translate_?z? rotate_?x rotate_?y rotate_?z? rectangle circle ellipse sphere path line_to move_to quad_to curve_to theme background contents locally time mouse_?x mouse_?y mouse_buttons'
id:
'text_length text_range text_find text_replace contains page slide basic_slide title_slide title subtitle ' +
'fade_in fade_out fade_at clear_color color line_color line_width texture_wrap texture_transform texture ' +
'scale_?x scale_?y scale_?z? translate_?x translate_?y translate_?z? rotate_?x rotate_?y rotate_?z? rectangle ' +
'circle ellipse sphere path line_to move_to quad_to curve_to theme background contents locally time mouse_?x ' +
'mouse_?y mouse_buttons'
};

@@ -13,0 +20,0 @@

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

"homepage": "https://highlightjs.org/",
"version": "8.7.0",
"version": "8.8.0",
"author": {

@@ -707,2 +707,22 @@ "name": "Ivan Sagalaev",

"email": "junookyo@gmail.com"
},
{
"name": "Philippe Charrière",
"email": "ph.charriere@gmail.com"
},
{
"name": "Stefan Bechert",
"email": "stefan.bechert@gmx.net"
},
{
"name": "Samuel Reed",
"email": "sam@bitmex.com"
},
{
"name": "Yury Selivanov",
"email": "yselivanov@gmail.com"
},
{
"name": "Tsuyusato Kitsune",
"email": "make.just.on@gmail.com"
}

@@ -709,0 +729,0 @@ ],

Sorry, the diff of this file is not supported yet

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