@mapbox/rehype-prism
Advanced tools
Comparing version 0.3.0 to 0.3.1
# Changelog | ||
## 0.3.1 | ||
- Allow uppercase language names in the `language-*` class (e.g. `language-CSS`). | ||
## 0.3.0 | ||
@@ -4,0 +8,0 @@ |
@@ -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", |
10
test.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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
114435
95
0