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

4

CHANGELOG.md
# Changelog
## 0.3.1
- Allow uppercase language names in the `language-*` class (e.g. `language-CSS`).
## 0.3.0

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

2

index.js

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

if (classListItem.slice(0, 9) === 'language-') {
return classListItem.slice(9);
return classListItem.slice(9).toLowerCase();
}

@@ -49,0 +49,0 @@ }

{
"name": "@mapbox/rehype-prism",
"version": "0.3.0",
"version": "0.3.1",
"description": "rehype plugin to highlight code blocks in HTML with Prism",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -32,2 +32,12 @@ 'use strict';

test('handles uppercase languages correctly', () => {
const result = processHtml(dedent`
<div>
<p>foo</p>
<pre><code class="language-CSS">p { color: red }</code></pre>
</div>
`);
expect(result).toMatchSnapshot();
});
test('does nothing to code block without language- class', () => {

@@ -34,0 +44,0 @@ const result = processHtml(dedent`

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