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

vue-md-loader

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-md-loader - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

package.json
{
"name": "vue-md-loader",
"version": "1.0.0",
"version": "1.1.0",
"description": "Webpack loader for converting Markdown files to ALIVE Vue components.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -219,2 +219,24 @@ # vue-md-loader

### process
Function. For example
```javascript
// This is useful when used with front-matter-loader to set the page title in nuxt projects
process: function(source){
let attrs = (source && source.attributes) || {}
attrs.title = attrs.title || ""
return {
template: source.body,
style: "",
script: `export default {
head(){
return {
title: '${attrs.title}'
}
}
}`
}
}
```
### afterProcess

@@ -221,0 +243,0 @@

@@ -47,2 +47,3 @@ const MarkdownIt = require('markdown-it')

preProcess: null,
process: null,
afterProcess: null

@@ -223,3 +224,10 @@ }

}
let result = this.options.live ? this.parseLives() : {template: source, script: '', style: ''}
let result
if (this.options.process && typeof this.options.process === 'function') {
result = this.options.process(this.source)
result.script = `<script>${result.script || ''}</script>`
result.style = `<style>${result.style || ''}</style>`
} else {
result = this.options.live ? this.parseLives() : {template: this.source, script: '', style: ''}
}
let html = this.markdown.render(result.template)

@@ -226,0 +234,0 @@ let vueFile = `<template><${this.options.wrapper}>${html}</${this.options.wrapper}></template>${result.style}${result.script}`

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