Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devlzl/richtexteditor
A custom rich text editor based on ProseMirror.
https://github.com/devlzl/richtexteditor
Last synced: 7 days ago
JSON representation
A custom rich text editor based on ProseMirror.
- Host: GitHub
- URL: https://github.com/devlzl/richtexteditor
- Owner: devlzl
- Created: 2022-11-08T16:10:02.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-09T16:10:32.000Z (almost 2 years ago)
- Last Synced: 2024-04-13T14:19:40.985Z (7 months ago)
- Language: JavaScript
- Size: 861 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rich Text Editor
A custom rich text editor based on ProseMirror.
Easily modify text styles, or insert image / audio / video.
Can load or save as markdown.
## Screenshot
![](./screenshot.png)## Usage
This project can be used directly as a ready-made editor.Or use `/src/components/Editor.vue` to wrap your own editor.
```sh
yarn
npx patch-package
yarn dev
```## API
```html```
```js
// "loadContent" should be an async function and return a string in markdown format.
async function loadContent() {
return '# Hello'
}// "input" event fires when the content has been changed.
function onInput(content) {
data.value = content
}// "uploadFile" should be an async function to upload the file to the server,
// and return an object with 'ok' and 'data' fields.
async function uploadFile(file) {
return {
ok: true,
data: 'https://somepath.xxx/foo.mp3'
}
}
```