tencent / cherry-markdown Goto Github PK
View Code? Open in Web Editor NEW✨ A Markdown Editor
License: Other
✨ A Markdown Editor
License: Other
不确定是不是cherry的问题。
在预览窗口调整图片的尺寸时,会出现异常滚动的问题,窗口不固定。导致调整起来很费劲。
如题
Describe the bug
when pasting from another editor, table content not parse when paste form another md editor (contains 0xA0 as space)
To Reproduce
Steps to reproduce the behavior:
0xA0.md
Expected behavior
can show the table in preview
Environment (please complete the following information):
After disabling phone mode left edit side becomes unscrollable.
Browser: Edge Version 95.0.1020.30 (Official build) (64-bit)
error Couldn't find package "cherry-markdown" on the "npm" registry.
多谢,解决我的问题了。
编辑区通常都比效果展示区篇幅短,导致在编辑区编辑时若要同步查看展示效果,有时候滚动操作并非能在水平对齐点查看到匹配的结果,通常展示区要更往下滚动多点,这样体验不是很好,所以cherry markdown能否支持编辑区对应的展示效果区始终与编辑区光标在同一水平线上
For most cases, mermaid should be enough, but for some people, they would like to use plantuml
** What does the proposed API look like**
Just like mermaid:
import Cherry from 'cherry-markdown/dist/cherry-markdown.core';
const registerPlugin = async () => {
const [{ default: CherryPlantumlPlugin }, plantuml] = await Promise.all([
import('cherry-markdown/src/addons/cherry-code-block-plantuml-plugin'),
import('plantuml'),
]);
Cherry.usePlugin(CherryPlantumlPlugin, {
plantuml, // pass in plantuml object
});
};
registerPlugin().then(() => {
// Plug-in registration must be done before Cherry is instantiated
const cherryInstance = new Cherry({
id: 'markdown-container',
value: '# welcome to cherry editor!',
});
});
Awesome markdown tool~ but when I open the demo page
https://tencent.github.io/cherry-markdown/examples/index.html
it comes blank page, with no error in console
Any idea deal with it?
Describe the bug
使用src引入MathJax时,多个实例切换时控制台会报错
To Reproduce
const options = {
...
engine: {
...
syntax: {
...
mathBlock: {
engine: 'MathJax', // katex或MathJax
src: './static/mathjax/text-svg.js'
},
...
}
this.cherry = new Cherry(this.options)
Expected behavior
正常显示,控制台无报错
Environment (please complete the following information):
Additional context
感觉像是Engine.js这里在动态加载script的时候没有做是否存在的判断,每次都会加载一遍对应的js文件,然后mathjax抛出了错误...
如果使用externals配置MathJax为window.MathJax同时设置mathBlock的src为空,此时可以自行控制引入js文件,但是插件(cherry配置默认引入的'input/asciimath', '[tex]/noerrors', '[tex]/cancel', '[tex]/color', '[tex]/boldsymbol')不会自动引入,需要手动一个一个去加载,感觉不太友好...
if (!window.MathJax) {
loadScript(MATH_JAX_LIB).then(() => {
this.initCherry()
})
} else {
this.initCherry()
}
设置externals时未自动加载plugins:
设置mathBlock.src时会自动加载同目录下的plugins:
exclude = ['bold']
export('pdf')
export('screenShot')
for
preview
mode
比如嵌入 draw.io 等,在文本形式下存储的可以是形如
```drawio
[base64 content]
```
这样的内容
为了避免在输入框里,base64的东西太长太乱,可以使用 CodeMirror 的 markText 方案,将其折叠并替换为一个占位符。点击占位符可以打开弹窗编辑内容
Describe the bug
在vite下无法使用
To Reproduce
Steps to reproduce the behavior:
Expected behavior
可以正确import
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
Describe the bug
Brought extra strange style when i pasted pieces of code, this feature is completely unable to use.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It will add the '**' tag what I don't need in my statement.
Environment (please complete the following information):
Additional context
Excess markers will appear from copying from Xcode.
Describe the bug
每一次调用setMarkdown或者setValue,光标都被重置到最前面了,对于封装成v-model形式的vue组件非常不友好
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
虽然图中的 markdown 语法不正确,但是当我复制代码块中的 latex 代码粘贴后,这个问题就会出现。
局部渲染和局部更新相对于 Bytemd 来说在长文本处理时性能确实提升了不少。相对于typora这种所见即所得的编辑器,我还是更喜欢 markdown 代码和渲染分开,感觉能看见 markdown 源代码会有安全感。另外 katex 貌似比 mathjax 在初次渲染时效果会好。另外我在文档中看到某些功能pro 版本可用,请问后续是会收费吗?后面的话我还是挺想用这个替换我博客里用的bytemd的😺
经常用Markdown画时序图,关键字有时候还是会写错,复杂的时候语法错了要排查好久。
期望能加强这方面能力
Describe the bug
when config.customSyntax is undefined, throw Error:
Uncaught TypeError: Cannot read properties of undefined (reading 'htmlBlock')
Environment (please complete the following information):
预览没有以光标选中的地方进行展示,我的光标在编辑页面 返回Demo 这块时,预览并没有显示对应的光标处的预览, RTX robinddu
- [引用] 对对对
[引用]: https://github.com/Tencent/cherry-markdown
Describe the bug
插入-图片失效,没有选择文件的弹框
To Reproduce
Steps to reproduce the behavior:
1.点击工具栏-插入
2.点击图片
Expected behavior
弹出选择文件的弹框
Environment (please complete the following information):
Additional context
这里的代码设置input类型的时候有问题,传入的['image', 'video', 'pdf']等是无效值,此时浏览器会将其设置为默认的'text',参考MDN文档所以不会出现选择文件的弹框。0.5.14版本中默认的就是'file',不知为何后来改掉了...另外目前没有限制指定类型的字段,希望加入限制,或添加相应的配置项。
https://github.com/WordPress/gutenberg
首先恭喜腾讯开源Markdown编辑器
另外,要提一点小建议。
目前看你们的编辑UI,可视化体验。还处于非常原始的阶段,咱们就不必继续挣扎在原始阶段,一步到位。直接借鉴wordpress 古腾堡的编辑体验。
这种所见即所得的体验,也是国内 语雀,飞书,等众多文档平台所采用的方案。极大地帮助人们快速编写文档,体验非常优秀。
Describe the bug
预览区和编辑区交替滚动时,编辑区无法滚动,无限回弹
To Reproduce
Expected behavior
编辑区能正常滚动
Environment (please complete the following information):
环境:React+AntDesign
代码:
import React, { useEffect } from 'react';
import { Modal } from 'antd';
import Cherry from 'cherry-markdown/dist/cherry-markdown.core';
useEffect(() => {
if (visible) {
const cherryInstance = new Cherry({
id: 'markdown-container',
value: '# welcome to cherry editor!',
});
}
}, [visible]);
<Modal
visible={visible}
title="markdown"
destroyOnClose
maskClosable={false}
width="80%"
>
<div id="markdown-container"/>
</Modal>
问题描述:我本意是想在弹窗里面加载markdown编辑器的,但是目前好像是没有识别到Modal弹窗里面的DOM节点,直接在整个页面的根节点上面自动创建了一个ID为markdown-container的DIV容器。
问题:就是想请问,是如何将编辑器加载到弹出框中的目标容器的?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.