metalsmith-prism 4.2.3 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +5 -0
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -5,6 +5,10 @@ const debug = require( 'debug' )( 'metalsmith-prism' );
5
5
  const extname = require( 'path' ).extname;
6
6
  const languages = require( 'prismjs' ).languages;
7
7
  const Prism = require( 'prismjs' );
8
+
9
+ const loadLanguages = require( 'prismjs/components/' );
10
+ loadLanguages( [ 'php' ] );
11
+
8
12
  const he = require( 'he' );
9
13
 
10
14
  const isHTMLFile = ( filePath ) => {
@@ -92,6 +96,7 @@ module.exports = ( options ) => {
92
96
 
93
97
  code.each( function() {
94
98
  const $this = $( this );
99
+
95
100
  const className = $this.attr( 'class' ) || '';
96
101
  const targets = className.split( 'language-' );
97
102
  let addLineNmbers = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metalsmith-prism",
3
- "version": "4.2.3",
3
+ "version": "4.3.0",
4
4
  "description": "Syntax highlighting for Metalsmith HTML templates using Prism.js",
5
5
  "main": "lib/index.js",
6
6
  "engines": {