Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mapbox/rehype-prism

Package Overview
Dependencies
Maintainers
14
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/rehype-prism - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

.husky/pre-commit

4

CHANGELOG.md
# Changelog
## 0.8.0
- Add `alias` option to support aliases in refractor.
## 0.7.0

@@ -4,0 +8,0 @@

@@ -10,2 +10,6 @@ 'use strict';

if (options.alias) {
refractor.alias(options.alias);
}
return (tree) => {

@@ -12,0 +16,0 @@ visit(tree, 'element', visitor);

25

package.json
{
"name": "@mapbox/rehype-prism",
"version": "0.7.0",
"version": "0.8.0",
"description": "rehype plugin to highlight code blocks in HTML with Prism",

@@ -11,3 +11,4 @@ "main": "index.js",

"pretest": "npm run lint",
"test": "jest"
"test": "jest",
"prepare": "husky install"
},

@@ -33,2 +34,3 @@ "repository": {

"hast-util-to-string": "^1.0.4",
"mrm": "^3.0.9",
"refractor": "^3.4.0",

@@ -40,8 +42,8 @@ "unist-util-visit": "^2.0.3"

"dedent": "^0.7.0",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"eslint-plugin-node": "^11.1.0",
"husky": "^4.3.8",
"jest": "^27.0.6",
"lint-staged": "^10.5.4",
"prettier": "^2.3.2",
"husky": "^7.0.2",
"jest": "^27.2.1",
"lint-staged": "^11.1.2",
"prettier": "^2.4.1",
"rehype": "^11.0.0"

@@ -53,9 +55,8 @@ },

"prettier --write"
],
"*.js": [
"eslint --fix",
"prettier --write"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"jest": {

@@ -62,0 +63,0 @@ "coverageReporters": [

@@ -41,2 +41,9 @@ # @mapbox/rehype-prism

#### options.alias
Type: `Record<string, string | string[]>`.
Default: `undefined`.
Provide [aliases] to refractor to register as alternative names for a language.
## Usage

@@ -108,1 +115,3 @@

[language supported by refractor]: https://github.com/wooorm/refractor#syntaxes
[aliases]: https://github.com/wooorm/refractor#refractoraliasname-alias

@@ -64,1 +64,15 @@ 'use strict';

});
test('with options.alias it can highlight language aliases', () => {
const html = dedent`
<pre>
<code class="language-vue">
&lt;script setup&gt;
const id = 7
&lt;/script&gt;
</code>
</pre>
`;
const result = processHtml(html, { alias: { markup: ['vue', 'html'] } });
expect(result).toMatchSnapshot();
});

Sorry, the diff of this file is not supported yet

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