Socket
Socket
Sign inDemoInstall

hexo-util

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-util - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

18

lib/highlight.js

@@ -15,6 +15,5 @@ 'use strict';

var firstLine = options.hasOwnProperty('firstLine') ? +options.firstLine : 1;
var lang = options.lang;
var caption = options.caption;
var tab = options.tab;
var data = highlight(str, lang);
var data = highlight(str, options);

@@ -75,5 +74,14 @@ if (!wrap) return data.value;

function highlight(str, lang){
if (!lang) return hljs.highlightAuto(str);
function highlight(str, options){
var lang = options.lang;
var autoDetect = options.hasOwnProperty('autoDetect') ? options.autoDetect : true;
if (!lang) {
if (autoDetect) {
return hljs.highlightAuto(str);
} else {
lang = 'plain';
}
}
var result = {value: ent.encode(str)};

@@ -100,2 +108,2 @@ lang = lang.toLowerCase();

}
}
}
{
"name": "hexo-util",
"version": "0.1.6",
"version": "0.1.7",
"description": "Utilities for Hexo.",

@@ -40,4 +40,4 @@ "main": "lib/index",

"ent": "^2.2.0",
"highlight.js": "^8.4.0"
"highlight.js": "^8.6.0"
}
}

@@ -40,5 +40,6 @@ # hexo-util

`first_line` | First line number | 1
`lang` | Language (Auto detect if not defined) |
`lang` | Language |
`caption` | Caption |
`tab`| Replace tabs |
`autoDetect` | Detect language automatically | true

@@ -45,0 +46,0 @@ ### htmlTag(tag, attrs, text)

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