vue-md-loader
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "vue-md-loader", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Webpack loader for converting Markdown files to ALIVE Vue components.", | ||
@@ -14,4 +14,5 @@ "main": "index.js", | ||
"lint": "eslint --ext .js,.vue .", | ||
"lint:fix": "npm run lint -- --fix", | ||
"test": "jest --coverage" | ||
"lint:fix": "pnpm lint -- --fix", | ||
"test": "jest --coverage", | ||
"test:watch": "pnpm test -- --watch" | ||
}, | ||
@@ -45,3 +46,3 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/preset-env": "7.16.0", | ||
"@babel/preset-env": "7.16.11", | ||
"babel-core": "6.26.3", | ||
@@ -52,14 +53,14 @@ "babel-eslint": "10.1.0", | ||
"cross-env": "7.0.3", | ||
"css-loader": "6.5.0", | ||
"eslint": "8.1.0", | ||
"css-loader": "6.6.0", | ||
"eslint": "8.8.0", | ||
"eslint-config-prettier": "8.3.0", | ||
"eslint-plugin-html": "6.2.0", | ||
"eslint-plugin-import": "2.25.2", | ||
"eslint-plugin-import": "2.25.4", | ||
"eslint-plugin-node": "11.1.0", | ||
"eslint-plugin-prettier": "4.0.0", | ||
"eslint-plugin-promise": "5.1.1", | ||
"eslint-plugin-vue": "8.0.3", | ||
"jest": "27.3.1", | ||
"eslint-plugin-promise": "6.0.0", | ||
"eslint-plugin-vue": "8.4.1", | ||
"jest": "27.5.0", | ||
"markdown-it-anchor": "8.4.1", | ||
"prettier": "2.4.1", | ||
"prettier": "2.5.1", | ||
"style-loader": "3.3.1", | ||
@@ -69,5 +70,5 @@ "vue": "2.6.14", | ||
"vue-template-compiler": "2.6.14", | ||
"webpack": "5.61.0", | ||
"webpack-cli": "4.9.1", | ||
"webpack-dev-server": "4.4.0" | ||
"webpack": "5.68.0", | ||
"webpack-cli": "4.9.2", | ||
"webpack-dev-server": "4.7.4" | ||
}, | ||
@@ -74,0 +75,0 @@ "dependencies": { |
# vue-md-loader | ||
![CI](https://github.com/wxsms/vue-md-loader/workflows/CI/badge.svg) | ||
[![Coverage Status](https://coveralls.io/repos/github/wxsms/vue-md-loader/badge.svg?branch=master)](https://coveralls.io/github/wxsms/vue-md-loader?branch=master) | ||
[![NPM Downloads](https://img.shields.io/npm/dm/vue-md-loader.svg)](https://www.npmjs.com/package/vue-md-loader) | ||
@@ -15,3 +14,3 @@ [![NPM Version](https://img.shields.io/npm/v/vue-md-loader.svg)](https://www.npmjs.com/package/vue-md-loader) | ||
* Built-in **syntax highlighter** with **[highlightjs](https://highlightjs.org/)**. | ||
* **Live demo** support. Extremely useful for document examples. | ||
* ✨**Live demo**✨ support. Extremely useful for document examples. | ||
* Vue 3 & vue-cli usage support. | ||
@@ -22,5 +21,5 @@ * Hot reload. | ||
This page [vue-md-loader.wxsm.space](https://vue-md-loader.wxsm.space) is generated by a markdown file. | ||
This page ([vue-md-loader.wxsm.space](https://vue-md-loader.wxsm.space)) is generated by a markdown file. Source: [/example](https://github.com/wxsms/vue-md-loader/tree/master/example). | ||
source: [/example](https://github.com/wxsms/vue-md-loader/tree/master/example) | ||
There is also a Vue 3 & Vue-cli example: [/example-vue3](https://github.com/wxsms/vue-md-loader/tree/master/example-vue3). | ||
@@ -92,3 +91,3 @@ ## Install | ||
## Markdown Alive! | ||
## ✨ Markdown Alive! | ||
@@ -227,3 +226,4 @@ A live demo is: | ||
Function. For example | ||
Function. For example: | ||
```javascript | ||
@@ -230,0 +230,0 @@ // This is useful when used with front-matter-loader to set the page title in nuxt projects |
@@ -126,6 +126,3 @@ const MarkdownIt = require('markdown-it') | ||
// Wrap it by options | ||
if ( | ||
this.options.afterProcessLiveTemplate && | ||
typeof this.options.afterProcessLiveTemplate === 'function' | ||
) { | ||
if (typeof this.options.afterProcessLiveTemplate === 'function') { | ||
template = this.options.afterProcessLiveTemplate(template) | ||
@@ -230,10 +227,7 @@ } | ||
this.source = source | ||
if ( | ||
this.options.preProcess && | ||
typeof this.options.preProcess === 'function' | ||
) { | ||
if (typeof this.options.preProcess === 'function') { | ||
this.source = this.options.preProcess(this.source) | ||
} | ||
let result | ||
if (this.options.process && typeof this.options.process === 'function') { | ||
if (typeof this.options.process === 'function') { | ||
result = this.options.process(this.source) | ||
@@ -249,6 +243,3 @@ result.script = `<script>${result.script || ''}</script>` | ||
let vueFile = `<template><${this.options.wrapper}>${html}</${this.options.wrapper}></template>${result.style}${result.script}` | ||
if ( | ||
this.options.afterProcess && | ||
typeof this.options.afterProcess === 'function' | ||
) { | ||
if (typeof this.options.afterProcess === 'function') { | ||
vueFile = this.options.afterProcess(vueFile) | ||
@@ -255,0 +246,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
16455
240