Comments (11)
It is recommended to save Markdown text instead of HTML, because Markdown can be transformed to HTML losslessly, while the reverse can not.
from hashmd.
I just ran npm i
Did you run it at examples/svelte
folder? The examples are not included in the monorepo.
from hashmd.
Yes, I downloaded the example/svelte folder, cd
and ran npm i
from hashmd.
Oh, it seems the package bytemd
and plugins are not listed in the dependencies of the example.
The temporary solutions is to run yarn && yarn dev
at the root folder, which would link all packages to the root node_modules
, which the example could access too.
from hashmd.
It worked, except the .flat()
wasn't supported by the browser, wrote one in rollup.config.json
from hashmd.
.flat() wasn't supported
Upgrade the Node.js version should solve this problem
from hashmd.
node --version
v15.1.0
Image uploaded to the editor is not working
from hashmd.
Yeah, it is because the upload
option is to simply convert image to base64, while the data:
scheme is not allowed by default.
There are two ways to solve this problem:
- Change the
upload
option to uploading the image files to the server then return a URL (Recommended)
importImage({
upload(files) {
return uploadFilesToServer(files) // return ['https://xxx']
},
}),
- Customize sanitize schema to allow
data:
scheme:
<Editor sanitize={(schema) => {
schema.protocols.src.push('data')
return schema
}} />
from hashmd.
Thanks for replying patiently. Now I feel the image doubt was pretty stupid; I should've gone through the source code.
from hashmd.
How do I access the rendered HTML in the svelte example?
from hashmd.
import { getProcessor } from 'bytemd'
const html = getProcessor({ plugins: [/*add your plugins*/] }).processSync('# markdown text').toString()
from hashmd.
Related Issues (20)
- Table of content title not selected if at the end of the markdown content HOT 4
- 中文输入时内容被输入法弹窗遮盖问题 HOT 4
- 编辑器窗口化时会闪屏,放大或缩小页面后没事 HOT 2
- 当我使用它作为流传输回数据展示时候,会出现页面白色闪动问题 HOT 2
- 如何拿到 codemirror 实例? HOT 3
- Editor don't work HOT 2
- WARN: Could not find the language 'mermaid', did you forget to load/include a language module? HOT 2
- 自定义插件里面怎么拿到markdown的原文啊? HOT 2
- how to using bytemd/vue with nuxt2 HOT 2
- [vue3+element plus ui] 在 `el-drawer` 组件中编辑区不显示初始内容
- 希望完善文档,文档太简陋了,编辑器的配置项都没列出来 HOT 4
- 有设置可以实现任何尺寸和mode下,toolbar一直显示吗? HOT 2
- iconfont图标不展示 HOT 2
- Make table of content accessible HOT 1
- Expose ./svelte/icons.js HOT 1
- About highlight.js tree-shaking HOT 1
- Preview write mode
- 能否在点击选项按钮时加上回调
- Is there a function to automatically extract summaries?
- img elements auto adds a paragraph?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hashmd.