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

strapi-markdown-parser

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-markdown-parser - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

25

index.js

@@ -36,15 +36,16 @@ class StrapiMarkdown {

parse = data => {
parse = async data => {
const item = await data
try {
for (let key in this.model) {
if (this.types.standard && this.types.standard.includes(this.model[key].type)) {
const out = this.marked(data[key] || '')
data[key] = out.length ? out : null
} else if (this.types.inline && this.types.inline.includes(this.model[key].type)) {
const out = this.marked.parseInline(data[key] || '')
data[key] = out.length ? out : null
if (item[key]) {
if (this.types.standard.includes(this.model[key].type)) {
item[key] = this.marked(item[key])
} else if (this.types.inline.includes(this.model[key].type)) {
item[key] = this.marked.parseInline(item[key])
}
}
}
return data
return item
} catch (err) {

@@ -58,5 +59,7 @@ console.error(err)

if (Array.isArray(data)) {
return data.map(obj => this.parse(obj))
const out = Promise.all(data.map(obj => this.parse(obj)))
return out
} else {
return this.parse(data)
const out = this.parse(data)
return out
}

@@ -63,0 +66,0 @@ } catch (err) {

{
"name": "strapi-markdown-parser",
"version": "0.0.10",
"version": "0.0.11",
"description": "Strapi controller module to parse Markdown to HTML",

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

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