lys-markdown-parser
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -304,3 +304,3 @@ 'use strict'; | ||
get head() { | ||
return /^(#{1,6})([^\n]*)\n?/; | ||
return /^\s*(#{1,6})([^\n]*)\n?/; | ||
}, | ||
@@ -307,0 +307,0 @@ |
{ | ||
"name": "lys-markdown-parser", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "js markdown parser", | ||
@@ -8,3 +8,6 @@ "main": "dist/index.js", | ||
"st": "anywhere -p 9001", | ||
"build": "rollup src/index.js --format cjs --file dist/index.js; babel dist --out-dir dist" | ||
"build:cjs": "rollup src/index.js --format cjs --file dist/index.js", | ||
"build:umd": "rollup src/index.js --format iife --name \"lymd\" --file dist/lymd.min.js", | ||
"min": "babel dist --out-dir dist; minify dist/index.umd.js -d dist", | ||
"build": "npm run build:cjs; npm run build:umd; npm run min" | ||
}, | ||
@@ -37,4 +40,5 @@ "repository": { | ||
"anywhere": "^1.5.0", | ||
"babel-minify": "^0.5.0", | ||
"rollup": "^0.67.4" | ||
} | ||
} |
@@ -30,2 +30,8 @@ # Markdown Parser | ||
### iief/umd | ||
在浏览器中直接引用`dist/lymd.min.js`使用 | ||
```js | ||
lymd.markdown(document.body, `# hello lymd`) | ||
``` | ||
## support rules | ||
@@ -32,0 +38,0 @@ 支持audio/video/iframe |
@@ -9,11 +9,10 @@ /** | ||
* diff array | ||
* 1. 先删除,根据type是否在nextNode里存在 | ||
* 2. diff filterPrevChildren与 nextChildren | ||
* 如果前后两次是node位置发生变化【比较复杂】 | ||
* 1. 先删除在nextNode里不存在的type | ||
* 2. 保留在nextNode里存在的type | ||
* 3. 删除剩余的元素,最后得到 prevKeepArr | ||
* 4. nextNode 与 prevKeepArr 最对比,进行move/add操作, | ||
* 需要注意的是在获取操作的过程,需要丢prevKeepArr进行同步更新 | ||
* 不然会导致操作混乱,数据不一致 | ||
* 5. 返回diff结果 | ||
* | ||
* 后一次插入了新的nodes【相对简单】 | ||
* [1 2 3 4] [1 2 6 3 4] | ||
* | ||
* 每种类型的个数是一致的,那么就是移动 | ||
* 每种类型的个数是不一致的,那么就是 | ||
*/ | ||
@@ -20,0 +19,0 @@ |
@@ -23,3 +23,3 @@ /* | ||
get head() { | ||
return /^(#{1,6})([^\n]*)\n?/ | ||
return /^\s*(#{1,6})([^\n]*)\n?/ | ||
}, | ||
@@ -26,0 +26,0 @@ get ul() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
243621
16
49
12
2774