Skip to content

Commit

Permalink
refactor: update renderer (doocs#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme authored Aug 22, 2024
1 parent b947503 commit a65c86e
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 237 deletions.
15 changes: 3 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta
name="keywords"
content="md,markdown,markdown-editor,wechat,official-account,yanglbme,doocs"
/>
<meta
name="description"
content="Wechat Markdown Editor | 一款高度简洁的微信 Markdown 编辑器"
/>
<meta name="keywords" content="md,markdown,markdown-editor,wechat,official-account,yanglbme,doocs" />
<meta name="description" content="Wechat Markdown Editor | 一款高度简洁的微信 Markdown 编辑器" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<title>微信 Markdown 编辑器 | Doocs 开源社区</title>
<link
rel="shortcut icon"
href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/favicon.png"
/>
<link rel="shortcut icon" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/favicon.png" />
<link
rel="apple-touch-icon-precomposed"
href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/1648303220922-7e14aefa-816e-44c1-8604-ade709ca1c69.png"
Expand Down
4 changes: 2 additions & 2 deletions src/components/CodemirrorEditor/UploadImgDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ function uploadImage(params) {
:deep(.CodeMirror) {
border: 1px solid #eee;
height: 300px !important;
font-family: 'Fira Mono', 'DejaVu Sans Mono', Menlo, Consolas,
'Liberation Mono', Monaco, 'Lucida Console', monospace !important;
font-family: 'Fira Mono', 'DejaVu Sans Mono', Menlo, Consolas, 'Liberation Mono', Monaco, 'Lucida Console',
monospace !important;
line-height: 20px;
.CodeMirror-scroll {
Expand Down
5 changes: 3 additions & 2 deletions src/stores/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ export const useStore = defineStore(`store`, () => {
// 更新编辑器
const editorRefresh = () => {
codeThemeChange()

const renderer = wxRenderer.getRenderer(isCiteStatus.value)
const renderer = wxRenderer
renderer.reset()
renderer.setOptions({ status: isCiteStatus.value, legend: legend.value })
marked.setOptions({ renderer })
let outputTemp = marked.parse(editor.value.getValue(0))

Expand Down
Loading

0 comments on commit a65c86e

Please sign in to comment.