Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
strapi-markdown-parser
Advanced tools
Strapi controller module to parse Markdown to HTML.
yarn add strapi-markdown-parser
Open your collection or single type's controller file (eg., ./api/{COLLECTION}/controllers/${COLLECTION}.js
), and add the following, substituting your collection or single type's name in the place of {COLLECTION}
:
const StrapiMarkdown = 'strapi-markdown-parser'
const model = require('../models/{COLLECTION}.settings.json')
const { md } = new StrapiMarkdown(model)
module.exports = {
async find(ctx) {
return md(await strapi.services.{COLLECTION}.find())
},
async findOne(ctx) {
return md(await strapi.services.{COLLECTION}.findOne())
}
}
StrapiMarkdown(model
, types
, options
)
model
(Object
)Your model's JSON settings file, eg. ./api/{collection}/models/{collection}.settings.json
.
types
(Object || Array
)Either an object or array specifying the types in your collection's model to transform to HTML. If an array, all fields will be treated as standard markdown and therefore paragraphs will be wrapped in <p>
tags. If an object, types specified under standard
will be wrapped in <p>
tags, an those specified inline
will not.
Defaults:
{
standard: ['richtext'],
inline: ['string', 'text']
}
options
(Object
)Uses Marked as a parser and therefore options correspond to the Marked API.
Defaults:
{
smartypants: true,
headerIds: false,
breaks: true
}
👤 Daniel Sieradski daniel@self.agency
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator
FAQs
Strapi controller module to parse Markdown to HTML
The npm package strapi-markdown-parser receives a total of 1 weekly downloads. As such, strapi-markdown-parser popularity was classified as not popular.
We found that strapi-markdown-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.