-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: suggester初始化机制;refactor: 最简版demo;fix: 超链接规则过严导致带感叹号的url被转义
- Loading branch information
Showing
7 changed files
with
67 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,8 @@ Cherry Markdown 有多种样式主题选择 | |
|
||
### 在线体验 | ||
|
||
- [basic](https://tencent.github.io/cherry-markdown/examples/index.html) | ||
- [全功能](https://tencent.github.io/cherry-markdown/examples/index.html) | ||
- [基础版](https://tencent.github.io/cherry-markdown/examples/basic.html) | ||
- [H5](https://tencent.github.io/cherry-markdown/examples/h5.html) | ||
- [多实例](https://tencent.github.io/cherry-markdown/examples/multiple.html) | ||
- [无 toolbar](https://tencent.github.io/cherry-markdown/examples/notoolbar.html) | ||
|
@@ -119,6 +120,7 @@ yarn add [email protected] | |
#### ESM | ||
|
||
```javascript | ||
import 'cherry-markdown/dist/cherry-markdown.css'; | ||
import Cherry from 'cherry-markdown'; | ||
const cherryInstance = new Cherry({ | ||
id: 'markdown-container', | ||
|
@@ -141,6 +143,7 @@ const htmlContent = cherryEngineInstance.makeHtml('# welcome to cherry editor!') | |
### 完整模式 (图形界面) | ||
|
||
```javascript | ||
import 'cherry-markdown/dist/cherry-markdown.css'; | ||
import Cherry from 'cherry-markdown/dist/cherry-markdown.core'; | ||
const cherryInstance = new Cherry({ | ||
id: 'markdown-container', | ||
|
@@ -165,6 +168,7 @@ const htmlContent = cherryEngineInstance.makeHtml('# welcome to cherry editor!') | |
核心构建包不包含 mermaid 依赖,需要手动引入相关插件。 | ||
|
||
```javascript | ||
import 'cherry-markdown/dist/cherry-markdown.css'; | ||
import Cherry from 'cherry-markdown/dist/cherry-markdown.core'; | ||
import CherryMermaidPlugin from 'cherry-markdown/dist/addons/cherry-code-block-mermaid-plugin'; | ||
import mermaid from 'mermaid'; | ||
|
@@ -189,6 +193,7 @@ const cherryInstance = new Cherry({ | |
**recommend** 使用异步引入,以下为 webpack 异步引入样例。 | ||
|
||
```javascript | ||
import 'cherry-markdown/dist/cherry-markdown.css'; | ||
import Cherry from 'cherry-markdown/dist/cherry-markdown.core'; | ||
|
||
const registerPlugin = async () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Cherry Editor - Markdown Editor</title> | ||
<link rel="stylesheet" type="text/css" href="../dist/cherry-markdown.css"> | ||
<link rel="Shortcut Icon" href="../logo/favicon.ico"> | ||
<style> | ||
html, | ||
html { | ||
height: 100%; | ||
} | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
height: 100%; | ||
overflow: hidden; | ||
margin: 0; | ||
} | ||
|
||
video { | ||
max-width: 400px; | ||
} | ||
|
||
#demo-val { | ||
display: none; | ||
} | ||
|
||
img { | ||
max-width: 100%; | ||
} | ||
iframe.cherry-dialog-iframe { | ||
width: 100%; | ||
height: 100%; | ||
#markdown { | ||
min-width: 1800px; | ||
max-width: 2600px; | ||
width: 70%; | ||
margin: 0 auto; | ||
} | ||
</style> | ||
<link rel="stylesheet" type="text/css" href="../dist/cherry-markdown.css"> | ||
<link rel="Shortcut Icon" href="./logo/favicon.ico"> | ||
<link rel="Shortcut Icon" href="../logo/favicon.ico"> | ||
<link rel="Bookmark" href="../logo/favicon.ico"> | ||
</head> | ||
|
||
<body> | ||
<div id="dom_mask" style="position: absolute; top: 40px; height: 20px; width: 100%;"></div> | ||
<div id="markdown"></div> | ||
<script src="../dist/cherry-markdown.js"></script> | ||
<script src="./scripts/basic.js"></script> | ||
</body> | ||
|
||
<script> | ||
var config = { | ||
id: 'markdown', | ||
value: '', | ||
callback: { | ||
afterChange: function(md, html) { | ||
console.log('change'); | ||
} | ||
}, | ||
}; | ||
var sourceCode = document.documentElement.outerHTML; | ||
var cherry = new Cherry(config); | ||
cherry.setValue(`##源码如下:\n\`\`\` html\n${sourceCode}\n\`\`\``); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters