Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
更符合中文的markdown编译器
npm install cmarked
最小的使用
var cmarked = require('cmarked')
console.log(cmarked('**我正在使用markdown语法书写文章**'))
//输出 <p><strong>我正在使用markdown语法书写文章</strong></p>
设置选项的例子,用默认值来示例:
var cmarked = require('cmarked')
cmarked.setOptions({
gap: '-',
smartOrderList: false
})
Type:String
h1-h6标题的id中的空格的填充符
例子
var cmarked = require('cmarked')
console.log(cmarked('# cmarked爱你'))
//输出 <h1 id='cmarked爱你'>cmarked爱你</h1>
console.log(cmarked('## cmarked 还 是 爱 你'))
//输出 <h2 id='cmarked-还-是-爱-你'>cmarked 还 是 爱 你</h2>
自定义填充符
var cmarked = require('cmarked')
cmarked.setOptions({
gap: '~'
})
console.log(cmarked('### cmarked 依 旧 爱 你'))
//输出 <h3 id='cmarked~依~旧~爱~你'>cmarked 依 旧 爱 你</h3>
// 连续的空格只会生成一个填充符
type: Boolean
default: false
是否使用智能的的有序列表,如果你的有序列表想要从不是1开头的,需要开启此选项。注意,原生的markdown并不支持此语法。
例子 - 不开启智能有序列表
var cmarked = require('cmarked')
console.log(cmarked('3. cmarked\n4. cmarked'))
//输出效果
//1. cmarked
//2. cmarked
例子 - 开启智能有序列表
var cmarked = require('cmarked')
console.log(cmarked('3. cmarked\n4. cmarked'))
//输出效果
//3. cmarked
//4. cmarked
目前该JavaScript包处于开发阶段,只在我的博客网站上面进行试用http://www.jiangxuan.org
如果你是开发者,请阅读dev.md
FAQs
更符合汉语的markdown编译器
The npm package cmarked receives a total of 12 weekly downloads. As such, cmarked popularity was classified as not popular.
We found that cmarked 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
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.