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

@gridsome/remark-prismjs

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gridsome/remark-prismjs - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

CHANGELOG.md

38

index.js
const Prism = require('prismjs')
const escapeHtml = require('escape-html')
const visit = require('unist-util-visit')
const loadLanguages = require('prismjs/components/index')
module.exports = options => {
loadLanguages(['graphql'])
// load all prismjs languages
require('prismjs/components/index')()
// highlight for graphql and static-query tags in html
Prism.languages.html.graphql = {
pattern: /(<(page|static)-query[\s\S]*?>)[\s\S]*?(?=<\/(page|static)-query>)/i,
inside: Prism.languages.graphql,
lookbehind: true,
greedy: true
}
// highlight page-query and static-query in html
Prism.languages.html.graphql = {
pattern: /(<(page|static)-query[\s\S]*?>)[\s\S]*?(?=<\/(page|static)-query>)/i,
inside: Prism.languages.graphql,
lookbehind: true,
greedy: true
}
return tree => {
visit(tree, 'code', node => {
node.type = 'html'
node.value = highlight(node, 'pre')
})
module.exports = () => tree => {
visit(tree, 'code', node => {
node.type = 'html'
node.value = highlight(node, 'pre')
})
visit(tree, 'inlineCode', node => {
node.type = 'html'
node.value = highlight(node, 'code')
})
}
visit(tree, 'inlineCode', node => {
node.type = 'html'
node.value = highlight(node, 'code')
})
}

@@ -29,0 +27,0 @@

{
"version": "0.0.3",
"version": "0.0.4",
"name": "@gridsome/remark-prismjs",

@@ -25,3 +25,3 @@ "description": "Prism for Gridsome",

},
"gitHead": "f096e39ab2b5eb3413dc9fe27cff3f48ed9ea033"
"gitHead": "8232162038e7431cd0e02096bb73c02d99a90012"
}

@@ -5,2 +5,6 @@ # @gridsome/remark-prismjs

## Install
- `yarn add @gridsome/remark-prismjs`
- `npm install @gridsome/remark-prismjs`
## Usage

@@ -7,0 +11,0 @@

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