mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
feat:markdown 渲染支持嵌入视频 (#2565)
This commit is contained in:
parent
f537adcc55
commit
d9dd2227a5
@ -52,6 +52,10 @@ order: 58
|
||||
}
|
||||
```
|
||||
|
||||
## 视频
|
||||
|
||||
可以使用 `![text](video.mp4)` 语法来嵌入视频。
|
||||
|
||||
## 属性表
|
||||
|
||||
| 属性名 | 类型 | 默认值 | 说明 |
|
||||
|
@ -518,6 +518,7 @@ if (fis.project.currentMedia() === 'publish') {
|
||||
'!mdurl/**',
|
||||
'!uc.micro/**',
|
||||
'!markdown-it/**',
|
||||
'!markdown-it-html5-media/**',
|
||||
'!punycode/**'
|
||||
],
|
||||
|
||||
@ -542,6 +543,7 @@ if (fis.project.currentMedia() === 'publish') {
|
||||
'mdurl/**',
|
||||
'uc.micro/**',
|
||||
'markdown-it/**',
|
||||
'markdown-it-html5-media/**',
|
||||
'punycode/**'
|
||||
],
|
||||
|
||||
@ -576,7 +578,8 @@ if (fis.project.currentMedia() === 'publish') {
|
||||
'!linkify-it/**',
|
||||
'!mdurl/**',
|
||||
'!uc.micro/**',
|
||||
'!markdown-it/**'
|
||||
'!markdown-it/**',
|
||||
'!markdown-it-html5-media/**'
|
||||
]
|
||||
}),
|
||||
postpackager: [
|
||||
|
@ -56,6 +56,7 @@
|
||||
"keycode": "^2.1.9",
|
||||
"lodash": "^4.17.15",
|
||||
"markdown-it": "^12.0.6",
|
||||
"markdown-it-html5-media": "^0.6.0",
|
||||
"match-sorter": "^6.3.0",
|
||||
"mobx": "^4.5.0",
|
||||
"mobx-react": "^6.1.4",
|
||||
|
@ -3,11 +3,15 @@
|
||||
*/
|
||||
|
||||
import markdownIt from 'markdown-it';
|
||||
// @ts-ignore
|
||||
import {html5Media} from 'markdown-it-html5-media';
|
||||
|
||||
const markdown = markdownIt({
|
||||
linkify: true
|
||||
});
|
||||
|
||||
markdown.use(html5Media);
|
||||
|
||||
export default function (content: string) {
|
||||
return markdown.render(content);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user