Comparing version 0.1.4 to 0.1.5
'use strict'; | ||
var ent = require('ent'); | ||
var hljs; | ||
@@ -76,3 +77,3 @@ | ||
var result = {value: str}; | ||
var result = {value: ent.encode(str)}; | ||
lang = lang.toLowerCase(); | ||
@@ -89,7 +90,11 @@ | ||
return tryHighlight(str, lang) || result; | ||
} | ||
function tryHighlight(str, lang){ | ||
try { | ||
return hljs.highlight(lang, str); | ||
} catch (err){ | ||
return result; | ||
return; | ||
} | ||
} | ||
} |
{ | ||
"name": "hexo-util", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Utilities for Hexo.", | ||
@@ -39,4 +39,5 @@ "main": "lib/index", | ||
"bluebird": "^2.6.2", | ||
"ent": "^2.2.0", | ||
"highlight.js": "^8.4.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27731
519
3
+ Addedent@^2.2.0
+ Addedent@2.2.1(transitive)
+ Addedpunycode@1.4.1(transitive)