<a href="https://marked.js.org">
<img width="60px" height="60px" src="https://marked.js.org/img/logo-black.svg" align="right" />
</a>
# Marked
[![npm](https://badgen.net/npm/v/marked)](https://www.npmjs.com/package/marked)
[![gzip size](https://badgen.net/badgesize/gzip/https://cdn.jsdelivr.net/npm/marked/marked.min.js)](https://cdn.jsdelivr.net/npm/marked/marked.min.js)
[![install size](https://badgen.net/packagephobia/install/marked)](https://packagephobia.now.sh/result?p=marked)
[![downloads](https://badgen.net/npm/dt/marked)](https://www.npmjs.com/package/marked)
[![github actions](https://github.com/markedjs/marked/workflows/Tests/badge.svg)](https://github.com/markedjs/marked/actions)
[![snyk](https://snyk.io/test/npm/marked/badge.svg)](https://snyk.io/test/npm/marked)
- â¡ built for speed
- â¬ï¸ low-level compiler for parsing markdown without caching or blocking for long periods of time
- âï¸ light-weight while implementing all markdown features from the supported flavors & specifications
- ð works in a browser, on a server, or from a command line interface (CLI)
## Demo
Checkout the [demo page](https://marked.js.org/demo/) to see marked in action â¹ï¸
## Docs
Our [documentation pages](https://marked.js.org) are also rendered using marked ð¯
Also read about:
* [Options](https://marked.js.org/using_advanced)
* [Extensibility](https://marked.js.org/using_pro)
## Compatibility
**Node.js:** Only [current and LTS](https://nodejs.org/en/about/releases/) Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time.
**Browser:** Not IE11 :)
## Installation
**CLI:**
```sh
npm install -g marked
```
**In-browser:**
```sh
npm install marked
```
## Usage
### Warning: ð¨ Marked does not [sanitize](https://marked.js.org/using_advanced#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the *output* HTML! ð¨
```
DOMPurify.sanitize(marked.parse(`<img src="x" onerror="alert('not happening')">`));
```
**CLI**
``` bash
# Example with stdin input
$ marked -o hello.html
hello world
^D
$ cat hello.html
<p>hello world</p>
```
```bash
# Print all options
$ marked --help
```
**Browser**
```html
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Marked in the browser</title>
</head>
<body>
<div id="content"></div>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
document.getElementById('content').innerHTML =
marked.parse('# Marked in the browser\n\nRendered by **marked**.');
</script>
</body>
</html>
```
or import esm module
```html
<script type="module">
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
document.getElementById('content').innerHTML =
marked.parse('# Marked in the browser\n\nRendered by **marked**.');
</script>
```
## License
Copyright (c) 2011-2022, Christopher Jeffrey. (MIT License)
没有合适的资源?快使用搜索试试~ 我知道了~
lodas和marked依赖项
共1070个文件
js:1053个
md:5个
map:3个
0 下载量 28 浏览量
2024-11-01
16:49:02
上传
评论
收藏 238KB 7Z 举报
温馨提示
lodas和marked依赖项
资源推荐
资源详情
资源评论
收起资源包目录
lodas和marked依赖项 (1070个子文件)
marked.1 2KB
marked.cjs 91KB
marked.d.cts 19KB
lodash.js 531KB
core.js 113KB
marked.umd.js 101KB
marked.esm.js 91KB
lodash.min.js 71KB
marked.min.js 36KB
_baseConvert.js 16KB
core.min.js 12KB
template.js 10KB
_mapping.js 10KB
wrapperLodash.js 7KB
main.js 6KB
debounce.js 6KB
_baseClone.js 5KB
_equalByTag.js 4KB
_createWrap.js 4KB
_deburrLetter.js 3KB
truncate.js 3KB
_createHybrid.js 3KB
_mergeData.js 3KB
_baseMergeDeep.js 3KB
_unicodeWords.js 3KB
_baseIsEqualDeep.js 3KB
_equalObjects.js 3KB
throttle.js 3KB
_equalArrays.js 3KB
array.js 2KB
random.js 2KB
transform.js 2KB
_baseIntersection.js 2KB
_initCloneByTag.js 2KB
_baseSortedIndexBy.js 2KB
_createFlow.js 2KB
mixin.js 2KB
memoize.js 2KB
_baseIsTypedArray.js 2KB
lang.js 2KB
_createRecurry.js 2KB
bindKey.js 2KB
isEmpty.js 2KB
_baseDifference.js 2KB
_baseUniq.js 2KB
every.js 2KB
_getTag.js 2KB
reduce.js 2KB
_lazyValue.js 2KB
_arrayLikeKeys.js 2KB
includes.js 2KB
_baseIsMatch.js 2KB
findLastIndex.js 2KB
defaults.js 2KB
spread.js 2KB
iteratee.js 2KB
bind.js 2KB
filter.js 2KB
object.js 2KB
sortBy.js 2KB
findIndex.js 2KB
invertBy.js 2KB
isPlainObject.js 2KB
curry.js 2KB
_unicodeSize.js 2KB
omit.js 2KB
map.js 2KB
overArgs.js 2KB
orderBy.js 2KB
deburr.js 2KB
cond.js 2KB
some.js 2KB
_compareMultiple.js 2KB
_unicodeToArray.js 2KB
partial.js 2KB
assign.js 2KB
_baseOrderBy.js 2KB
partialRight.js 2KB
split.js 2KB
differenceBy.js 1KB
toNumber.js 1KB
partition.js 1KB
curryRight.js 1KB
_createCtor.js 1KB
intersectionBy.js 1KB
result.js 1KB
_basePullAll.js 1KB
matchesProperty.js 1KB
_createCurry.js 1KB
escape.js 1KB
matches.js 1KB
invokeMap.js 1KB
_baseSortedIndex.js 1KB
_baseIsNative.js 1KB
reject.js 1KB
dropRightWhile.js 1KB
chunk.js 1KB
templateSettings.js 1KB
toArray.js 1KB
groupBy.js 1KB
共 1070 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
owerm
- 粉丝: 159
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功