Socket
Socket
Sign inDemoInstall

lowlight

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lowlight - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

3

index.js

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

low.registerLanguage('http', require('highlight.js/lib/languages/http'));
low.registerLanguage('hy', require('highlight.js/lib/languages/hy'));
low.registerLanguage('inform7', require('highlight.js/lib/languages/inform7'));

@@ -103,2 +104,3 @@ low.registerLanguage('ini', require('highlight.js/lib/languages/ini'));

low.registerLanguage('ldif', require('highlight.js/lib/languages/ldif'));
low.registerLanguage('leaf', require('highlight.js/lib/languages/leaf'));
low.registerLanguage('less', require('highlight.js/lib/languages/less'));

@@ -123,2 +125,3 @@ low.registerLanguage('lisp', require('highlight.js/lib/languages/lisp'));

low.registerLanguage('moonscript', require('highlight.js/lib/languages/moonscript'));
low.registerLanguage('n1ql', require('highlight.js/lib/languages/n1ql'));
low.registerLanguage('nginx', require('highlight.js/lib/languages/nginx'));

@@ -125,0 +128,0 @@ low.registerLanguage('nimrod', require('highlight.js/lib/languages/nimrod'));

37

lib/core.js

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

var KEY_INSENSITIVE = 'case_insensitive';
var KEY_CACHED_VARIANTS = 'cached_variants';
var EMPTY = '';

@@ -221,7 +222,3 @@

while (match) {
count = processLexeme(
value.substr(offset, match.index - offset),
match[0]
);
count = processLexeme(value.substring(offset, match.index), match[0]);
offset = top.terminators.lastIndex = match.index + count;

@@ -428,3 +425,3 @@ match = top.terminators.exec(value);

while (keyword) {
addText(modeBuffer.substr(lastIndex, keyword.index - lastIndex), nodes);
addText(modeBuffer.substring(lastIndex, keyword.index), nodes);

@@ -555,6 +552,15 @@ submatch = keywordMatch(top, keyword);

function expandMode(mode) {
if (mode.variants && !mode[KEY_CACHED_VARIANTS]) {
mode[KEY_CACHED_VARIANTS] = mode.variants.map(function (variant) {
return inherit(mode, {variants: null}, variant);
});
}
return mode[KEY_CACHED_VARIANTS] || (mode.endsWithParent && [inherit(mode)]) || [mode];
}
/* Compile a language. */
function compileLanguage(language) {
compileMode(language);
return;

@@ -564,3 +570,2 @@ /* Compile a language mode, optionally with a parent. */

var compiledKeywords = {};
var expandedContains = [];
var terminators;

@@ -628,14 +633,6 @@

mode.contains.forEach(function (c) {
if (c.variants) {
c.variants.forEach(function (v) {
expandedContains.push(inherit(c, v));
});
} else {
expandedContains.push(c === 'self' ? mode : c);
}
});
mode.contains = Array.prototype.concat.apply([], mode.contains.map(function (c) {
return expandMode(c === 'self' ? mode : c);
}));
mode.contains = expandedContains;
mode.contains.forEach(function (c) {

@@ -661,4 +658,2 @@ compileMode(c, mode);

return;
/* Flatten a classname. */

@@ -665,0 +660,0 @@ function flatten(className, value) {

{
"name": "lowlight",
"version": "1.6.0",
"version": "1.7.0",
"description": "Virtual syntax highlighting for virtual DOMs and non-HTML things",

@@ -27,19 +27,19 @@ "license": "MIT",

"dependencies": {
"highlight.js": "~9.9.0"
"highlight.js": "~9.10.0"
},
"devDependencies": {
"browserify": "^13.0.0",
"browserify": "^14.0.0",
"chalk": "^1.1.1",
"esmangle": "^1.0.0",
"rehype": "3.0.0",
"rehype": "4.0.0",
"nyc": "^10.0.0",
"remark-cli": "^2.0.0",
"remark-preset-wooorm": "^1.0.0",
"remark-cli": "^3.0.0",
"remark-preset-wooorm": "^2.0.0",
"tape": "^4.0.0",
"unist-util-visit": "^1.0.0",
"xo": "^0.17.0"
"xo": "^0.18.0"
},
"scripts": {
"build-registry": "node script/build-registry",
"build-md": "remark . --quiet --frail",
"build-md": "remark . -qfo",
"build-bundle": "browserify index.js --bare -s lowlight > lowlight.js",

@@ -61,3 +61,6 @@ "build-mangle": "esmangle lowlight.js > lowlight.min.js",

"space": true,
"esnext": false,
"rules": {
"unicorn/prefer-type-error": "off",
"no-multi-assign": "off",
"max-lines": "off",

@@ -71,5 +74,4 @@ "max-params": "off"

"remarkConfig": {
"output": true,
"presets": "wooorm"
"plugins": ["preset-wooorm"]
}
}

@@ -8,3 +8,3 @@ # lowlight [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]

Lowlight is built to work with all syntaxes supported by [highlight.js][],
that’s [168 languages][names] (and all 73 themes).
that’s [172 languages][names] (and all 73 themes).

@@ -11,0 +11,0 @@ ## Table of Contents

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