Socket
Socket
Sign inDemoInstall

hexo-util

Package Overview
Dependencies
Maintainers
8
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 2.6.0 to 2.6.1

18

lib/prism.js

@@ -9,4 +9,16 @@ 'use strict';

const prismComponents = require('prismjs/components');
const prismSupportedLanguages = Object.keys(prismComponents.languages);
const prismAlias = Object.entries(prismComponents.languages).reduce((acc, [key, value]) => {
if (value.alias) {
if (Array.isArray(value.alias)) {
value.alias.forEach(alias => (acc[alias] = key));
} else if (typeof value.alias === 'string') {
acc[value.alias] = key;
}
}
return acc;
}, {});
const prismSupportedLanguages = Object.keys(prismComponents.languages).concat(Object.keys(prismAlias));
const escapeHTML = require('./escape_html');

@@ -63,4 +75,6 @@

// To be consistent with highlight.js
const language = lang === 'plaintext' || lang === 'none' ? 'none' : lang;
let language = lang === 'plaintext' || lang === 'none' ? 'none' : lang;
if (prismAlias[language]) language = prismAlias[language];
const preTagClassArr = [];

@@ -67,0 +81,0 @@ const preTagAttrArr = [];

4

lib/toc_obj.js

@@ -44,3 +44,3 @@ 'use strict';

for (const element of el.children) {
const elText = DomUtils.getText(element);
const elText = DomUtils.textContent(element);
// Skip permalink symbol wrapped in <a>

@@ -53,3 +53,3 @@ // permalink is a single non-word character, word = [a-Z0-9]

}
if (!text) text = escapeHTML(DomUtils.getText(el));
if (!text) text = escapeHTML(DomUtils.textContent(el));

@@ -56,0 +56,0 @@ const res = { text, id, level };

{
"name": "hexo-util",
"version": "2.6.0",
"version": "2.6.1",
"description": "Utilities for Hexo.",

@@ -5,0 +5,0 @@ "main": "lib/index",

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