@gridsome/remark-prismjs
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.5.0](https://github.com/gridsome/gridsome/tree/master/packages/remark-prismjs/compare/@gridsome/remark-prismjs@0.4.0...@gridsome/remark-prismjs@0.5.0) (2020-11-04) | ||
### Features | ||
* **prismjs:** add custom class prefix ([#1348](https://github.com/gridsome/gridsome/tree/master/packages/remark-prismjs/issues/1348)) ([0415068](https://github.com/gridsome/gridsome/tree/master/packages/remark-prismjs/commit/0415068ab8e590a25c6306334782c199f388cdb4)) | ||
# [0.4.0](https://github.com/gridsome/gridsome/tree/master/packages/remark-prismjs/compare/@gridsome/remark-prismjs@0.3.0...@gridsome/remark-prismjs@0.4.0) (2020-08-20) | ||
@@ -8,0 +19,0 @@ |
@@ -10,3 +10,3 @@ const h = require('hastscript') | ||
// load all prismjs languages | ||
require('prismjs/plugins/custom-class/prism-custom-class') | ||
require('prismjs/components/index')() | ||
@@ -16,2 +16,3 @@ | ||
{ | ||
customClassPrefix = '', | ||
transformInlineCode = false, | ||
@@ -21,2 +22,4 @@ showLineNumbers: showLineNumbersGlobal = false | ||
) => tree => { | ||
Prism.plugins.customClass.prefix(customClassPrefix) | ||
visit(tree, 'code', (node, index, parent) => { | ||
@@ -23,0 +26,0 @@ parent.children.splice(index, 1, createCode(node, showLineNumbersGlobal)) |
{ | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"name": "@gridsome/remark-prismjs", | ||
@@ -28,3 +28,3 @@ "description": "Syntax highlighter for markdown code blocks", | ||
}, | ||
"gitHead": "012c1989a1696015dc9e86ddd5964f6cfd0744c8" | ||
"gitHead": "bb70dcd9662383804515a1fc65309f2ad9e71b2e" | ||
} |
@@ -65,2 +65,10 @@ # @gridsome/remark-prismjs | ||
#### customClassPrefix | ||
- Type: `String` | ||
- Default: `''` | ||
If Prism's default classes are too generic and cause conflicts, you can add a prefix like `"prism--"` to all Prism | ||
classes by passing it in as the `customClassPrefix`. | ||
#### transformInlineCode | ||
@@ -67,0 +75,0 @@ |
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
11422
137
98