Giter Club home page Giter Club logo

fantasy-editor's Introduction

English | 简体中文

Fantasy Editor

A Rich Text Editor Based On Slate and React.

GitHub npm npm

Installation

npm

npm install fantasy-editor --save

Examples

# Clone the repository
$ git clone https://github.com/lingjieee/fantasy-editor.git

# Change directory
$ cd fantasy-editor

# Install dependencies
$ yarn install

# Run examples
$ yarn start

fantasy-editor's People

Contributors

dependabot[bot] avatar lingjieee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fantasy-editor's Issues

a bug

重现步骤:

打开 https://fantasy-editor.jieee.dev/examples/full

删除所有内容, 输入 任意内容,并转换为代码块, 如 输入很多个 11111111111111

并把他们转换为一个代码块
image

选中一部分内容,并设置一个任意颜色

image

编辑器就崩溃了

can you support ```js when i insert code block ?

https://fantasy-editor.jieee.dev/examples/full

i can enter ```,then enter space button, it's work

then i enter ```js or ```javascript or ```python , then enter space button, it's not work

can you fix it ?

thank you very much

=====
中文版:
你好,我想插入代码块 , 但是编辑器只支持 ```, 不支持设定特定语言,如 ```js , ```python ,

如果我在 ```后面加了特定语言的标记, 按空格后,没有自动生成一个代码块

请问有办法解决吗

谢谢

删除编辑器里所有内容后,输入中文会导致编辑器崩溃

以这个demo的代码为例子 https://fantasy-editor.jieee.dev/examples/serialize/markdown

我把里面的 value.json 文件的内容修改为了: [{ "type":"paragraph", "children": [{ "text":"" }] }]

目的是让编辑器初始值为空

然后我随便输入一点内容, 接着全选,删除编辑器里所有内容(可能会按下很多次删除键)

然后切换到中文输入法, 输入中文,

然后编辑器就崩溃了(并非每次都崩溃,但概率极大,可能90%的概率)

这是报错信息:

Error: Cannot resolve a Slate point from DOM point: [object Text],1
image
image

我简单的查询了下,和这个 问题有点像 ianstormtaylor/slate#3753

在react中运行时报错

按照示例在react中运行时报错

Error: The useSlate hook must be used inside the component's context.
请问如何解决

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.