https://github.com/coralproject/rte
A Lightweight Rich Text Editor based on React
https://github.com/coralproject/rte
react rich-text-editor rte typescript
Last synced: about 1 year ago
JSON representation
A Lightweight Rich Text Editor based on React
- Host: GitHub
- URL: https://github.com/coralproject/rte
- Owner: coralproject
- License: other
- Created: 2018-08-24T08:02:11.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2023-07-18T22:03:56.000Z (about 3 years ago)
- Last Synced: 2025-04-18T15:33:11.423Z (over 1 year ago)
- Topics: react, rich-text-editor, rte, typescript
- Language: TypeScript
- Size: 1.67 MB
- Stars: 6
- Watchers: 9
- Forks: 3
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Coral RTE [](https://circleci.com/gh/coralproject/rte)
Coral RTE is a lightweight and extensible Rich Text Editor based on React and [Squire](https://github.com/neilj/Squire).
[Demo](https://coralproject-rte.netlify.app/)
## Installation
```bash
npm install @coralproject/rte --save-dev
```
## Usage
```js
import { CoralRTE, Bold, Italic, Blockquote } from "@coralproject/rte";
import createDOMPurify from "dompurify";
// See https://github.com/cure53/DOMPurify
const DOMPurify = createDOMPurify(window);
const sanitizeToDOMFragment = (html) => {
if (!html) {
return document.createDocumentFragment();
}
return DOMPurify.sanitize(html, { RETURN_DOM_FRAGMENT: true });
};
setValue(html)}
value={value}
disabled={disabled}
placeholder={"Enter some content"}
features={[, ,
]}
toolbarPosition="bottom"
sanitizeToDOMFragment={sanitizeToDOMFragment}
/>;
```
## Development
```bash
npm run dev
```
## Build
```bash
npm run build
```
## Releasing
When you're ready to release a new vesrion of `@coralproject/rte`,
you can do the following:
1. Run `npm version --no-git-tag-version (major|minor|patch)` to update the
version number in package files.
2. Push the changes to a new branch, and submit a PR against `main`.
3. Once the changes have been approved, and all the code you want to deploy for
the version is in `main`, create a release with the version number: `v0.4.0`
(Note that the `v` prefix is required)
CircleCI will run your tests and release the new version for you.