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.3.0 to 2.4.0

11

lib/highlight.js

@@ -33,3 +33,2 @@ 'use strict';

const figCaption = caption ? `<figcaption>${caption}</figcaption>` : '';

@@ -47,6 +46,12 @@ const lines = data.value.split('\n');

let codeCaption = '';
if (caption) {
codeCaption = wrap ? `<figcaption>${caption}</figcaption>` : `<div class="caption">${caption}</div>`;
}
if (!wrap) {
// if original content has one trailing newline, replace it only once, else remove all trailing newlines
content = /\r?\n$/.test(data.value) ? content.replace(/\n$/, '') : content.trimEnd();
return `<pre>${figCaption}<code class="${classNames}">${content}</code></pre>`;
return `<pre>${codeCaption}<code class="${classNames}">${content}</code></pre>`;
}

@@ -56,3 +61,3 @@

result += figCaption;
result += codeCaption;

@@ -59,0 +64,0 @@ result += '<table><tr>';

@@ -65,3 +65,4 @@ 'use strict';

firstLine,
isPreprocess = true
isPreprocess = true,
caption
} = options;

@@ -101,3 +102,5 @@

const startTag = `<pre class="${preTagClassArr.join(' ')}"${preTagAttr}><code class="language-${language}">`;
const codeCaption = caption ? `<div class="caption">${caption}</div>` : '';
const startTag = `<pre class="${preTagClassArr.join(' ')}"${preTagAttr}>${codeCaption}<code class="language-${language}">`;
const endTag = '</code></pre>';

@@ -104,0 +107,0 @@

{
"name": "hexo-util",
"version": "2.3.0",
"version": "2.4.0",
"description": "Utilities for Hexo.",

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

@@ -454,2 +454,3 @@ # hexo-util

`firstLine` | First line number |
`caption` | Caption |

@@ -456,0 +457,0 @@ When `isPreprocess` is enabled, `prismHighlight()` will return PrismJS processed HTML snippet. Otherwise `str` will only be escaped and `prismHighlight()` will return the HTML snippet that is suitable for `prism.js` working in the Browser.

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