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

cmarked

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmarked - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

dev.md

50

lib/cmarked.js

@@ -105,3 +105,3 @@ 'use strict'

case 'text': {
return this.renderer.text(this.token.text)
return this.renderer.paragraph(this.parseText())
}

@@ -129,2 +129,11 @@ case 'list_start': {

}
case 'loose_item_start': {
let body = ''
while(this.next().type !== 'list_item_end') {
body += this.tok()
}
return this.renderer.listitem(body)
}
}

@@ -139,6 +148,9 @@ }

let inline = {
escape: /^\\[\\`*{}\[\]()#+\-.!_>]/,
link: /^!?\[(inside)\]\(href\)/,
autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
autolink: /^<([^ >]+(:\/|@)[^ >]+)>/,
code: /^(`+)\s*([\s\S]+?[^`])\s*\1(?!`)/,
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/,
strong: /^__([\s\S]+?)__(?!__)|^\*\*([\s\S]+?)\*\*(?!\*)/,
em: /^\b_((?:\\_|[^_]|__)+?)_\b|\*((?:\\\*|[^\*]|\*\*)+?)\*/
}

@@ -183,2 +195,18 @@ inline._inside = /.*?/

if(cap = this.rules.strong.exec(src)) {
debugger
src = src.substring(cap[0].length)
out += this.renderer.strong(this.output(cap[2] || cap[1]))
continue
}
if(cap = this.rules.em.exec(src)) {
debugger
src = src.substring(cap[0].length)
out += this.renderer.em(this.output(cap[1] || cap[2]))
}
if(cap = this.rules.autolink.exec(src)) {

@@ -298,3 +326,5 @@ src = src.substring(cap[0].length)

+ ' id="'
+ id.replace(/ +?[^ ]/g, this.options.gap)
// 这里的替换不能把不是空格的字符也捕获
// + id.replace(/ +?[^ ]/g, this.options.gap) ✖️
+ id.replace(/ +?(?! )/g, this.options.gap) // ✔️
+ '">'

@@ -313,2 +343,14 @@ + text

strong(text) {
return '<strong>'
+ text
+ '</strong>'
}
em(text) {
return '<em>'
+ text
+ '</em>'
}
link(href, title, text) {

@@ -315,0 +357,0 @@ let out = '<a href="' + href + '"'

2

package.json
{
"name": "cmarked",
"version": "1.0.12",
"version": "1.0.13",
"description": "更符合汉语的markdown编译器",

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

@@ -86,3 +86,8 @@ # cmarked

目前该JavaScript包处于开发阶段,只在我的博客网站上面进行试用<http://www.jiangxuan.org>
如果你是开发者,请阅读dev.md

Sorry, the diff of this file is not supported yet

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