Git Product home page Git Product logo

plate's Introduction

Plate

Total Downloads PRs Welcome
Powered by Vercel

hero

Templates

You can choose one of the following templates to get started:

Option NextJS Tailwind Plate Plugins
Plate playground template
Plate minimal template
NextJS template

Documentation

You can learn more about Plate by checking out our documentation.

Contributing

To get started, check out our contributing guide.

Contributors

We'd love for you to join us! Whether it's through giving us a 🌟 star, making a 📥 pull request, or sharing your plugins, your help is always appreciated.

Star History Chart

Need more help? Join us on Discord. We're always here to guide you.

plate's People

Contributors

12joan avatar aj-foster avatar alantrrs avatar alex-vladut avatar allcontributors[bot] avatar archie9211 avatar bensquire avatar bojangles-m avatar danlunde avatar dependabot-preview[bot] avatar dimaanj avatar dylans avatar felixfeng33 avatar gaelbonjour avatar ghingis avatar github-actions[bot] avatar haydencarlson avatar horacioh avatar karthikcodes6 avatar korovinquantori avatar liboul avatar nemanja-tosic avatar oliverwales avatar rishi-raj-jain avatar shahriar-shojib avatar spetex avatar stephenkiers avatar vmaark avatar wcaleniewolny avatar zbeyens 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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plate's Issues

The order of elements is not preserved when pasting multiple elements

When pasting a few paragraphs of text (including a block quote) from within Slate, the order of elements is not preserved on pasting.

Steps to reproduce

  1. Create three paragraphs of content: plain text paragraph, a block quote and plain text paragraph (see screen shot below).
    image
  2. Copy the three paragraphs and try pasting further down in the same document.
  3. Notice that that the result does not preserve the order of the elements copied: the two plain text paragraph nodes are pasted before the block quote (see below).

image

Autoformat plugin does not clear formatting character

Hi, I'm running into a few issues with the Autoformat plugin. All of these issues can be replicated on the storybook example.

  • Does not clear up initial formatting character

image

  • Due to this stray character sometimes the editor crashes. In order to replicate this please try adding * around the "Autoformat" heading in storybook and pressing Space. Please see the initial part of the error log:
Uncaught Error: Cannot find a descendant at path [0,0,2] in node: {"children":[{"children":[{"type":"h1","children":[{"text":"🏃‍♀️ *"},{"text":"Autoformat","italic":true}]}, ...

Environment

Firefox only

EditablePluginsProps type is not correct

EditablePluginsProps was changed recently to be defined as

export interface EditablePluginsProps extends Omit<React.TextareaHTMLAttributes<HTMLDivElement>, 'onKeyDown'>

which means that it's expecting properties like

value: string;
onChange: (event: ChangeEvent<HTMLDivElement>) => void;

which are not correct.

Error: Cannot get the parent path of the root path []

Thank you for this fantastic collection of plugins! It's has been extremely useful to me at work.

I just want to report a list related bug which seems to be introduced in v0.57.2. It looks like isPointAtRoot utility function's logic may be incorrect. I'm seeing Error: Cannot get the parent path of the root path [] error every once in a while though I haven't been able to reproduce it reliably. I will add the steps as soon as I figure it out.
Screen Shot 2020-04-28 at 1 57 12 PM

cannot add type field to Mention seed values

Seeding a objects with type field breaks the plugin functionality. If we can work around it somehow that would be the best. Otherwise we should add this to the documentation as a limitation and make an assertion about it, and logging would be beneficial for the end user.

Delete forward can break a list

On delete forward in a block before a list ul, the ul element is removed, moving the li element at the root

IAk4WoLJBy

One solution would be to create a plugin withList which overrides editor.deleteForward or editor.normalizeNode to invalidate li elements at the root.

Document editing crashes when initial values is taken from html.

Hello,

I have used the provided htmlDeserialize function to parse HTML and provide the result as an initialValue for Slate Editor.

In case that the input looks like this:

'Some random string';

I ran it through my function that constructs the DOM Node

const htmlStringToDOMNode = (rawHtml: string) => {
  const node = document.createElement('body');
  node.innerHTML = rawHtml.replace(/(\r\n|\n|\r|\t)/gm, '');
  return node;
};

and it creates this:

<body>Some random string</body>

that in turn gets fed into the htmlDeserialize function which returns Slate format representation:

[
  { text: 'Some random string' }
]

That gets to be inserted as initialValue into the state of the component.

Everything looks alright, but when you try to edit anything the editor crashes.

Example here: https://codesandbox.io/s/htmldeserialize-bug-simple-text-cb1nf?file=/index.tsx

I would be glad if anyone could point me towards what am I doing wrong here.

fix mention plugin docs in storybook

The documentation for MentionPlugin is broken.
The issue is the side-effect of returning the components from the useMention, so they cannot be correctly listed in the subcomponents section of story's default export.
Maybe it can be fixed with MDX.

WithNodeID split node with the same id

I have tested the plugin here: https://codesandbox.io/s/slate-plugins-reproductions-yxr3q
I don't know if it's a bug. When I split a node in the editor, it creates a new node with the same id.

it shouldn't create a new id for the new node?

Initial node:

{
    "type": "paragraph",
    "children": [
      {
        "text": "This is editable"
      }
    ],
    "id": "df739b1d-b2f9-48e0-b86d-74a931308226"
  },

result:

{
    "type": "paragraph",
    "children": [
      {
        "text": "This is"
      }
    ],
    "id": "df739b1d-b2f9-48e0-b86d-74a931308226"
  },
  {
    "type": "paragraph",
    "children": [
      {
        "text": "editable"
      }
    ],
    "id": "df739b1d-b2f9-48e0-b86d-74a931308226"
  }

Alignment

Use a wrapping node to align block elements with text-align.

Toggle list should work anywhere in the list

There are some strange behaviors when toggling list (click on the button) on nested lists. If you play with it on the storybook for a while its very easy to come up with these situations.

I would expect that only li nodes could be children of ul nodes but that is not the case. Are my expectations reasonable?

An example

- ul
  - li
    - p A
    - ul
      - li
        - p B <- toggle list here
        - ul
          - li
            - p C

becomes

- ul
  - li
    - p A
    - p B <- toggle list here one more time
    - ul
      - ul
        - li
          - p C

becomes

- ul
  - p A
- p B <- toggle list here one more time
- ul
  - ul
    - ul
      - li
        - p C

I hope this makes sense 😅

Cant add text or clear all content after adding images at the end of content.

Bug Report

Description

I was playing around with examples in the storybook and I stumbled up the issue in images example.
basically, when you add an image using a button in the toolbar at the end of the content you won't get cursor below image neither you can click below image to get the cursor back.

How to reproduce

Open images example in the storybook and add an image at the bottom of the content. you won't be able to add content anymore. now another issue select all content by pressing mod+a and hit the backspace key content doesn't' get removed.

Expected behaviour

  1. After adding image user should be able to write content below it editor should not hit dead end.
  2. Even if we hit dead end by adding image user should be able to clear all content by selecting all content and hitting backspace.

If you need more information or any kind of help i would love to help out :)

Make EditablePlugins usable standalone without peer dependencies

I would love to use the EditablePlugins component as it clearly provides a solid way to write standalone plugins for the slate editor.
Unfortunately, it cannot be used without installing the peer dependencies for the shipped plugins which i am not intending to use.
I think it makes sense to split this up into a "core" package containing EditablePlugins and a "plugins" package containing plugins built on top

Paste HTML - first element style missing

The HTML paste plugin has a minor problem with the first element in the pasted content. Seems like it always ends up as a paragraph - not the type it really is.

For example I try pasting this HTML:

<h1>first heading</h1>
<p>first text</p>
<h1>second heading</h1>
<p>second text</p>

But the editor ends up showing it like this - with the first H1-element converted to a regular paragraph:
image

It does not matter if the pasted HTML is first - or if there is content in the editor above. Have been trying to figure out why this is happening without success. Anyone has any idea?

Can not serialize multiple marks to HTML

Issue from Alex.

Hi. I'm trying to serialize mixed inline tags into a fragment. Even though the following has three tags, htmlSerialize returns <p><strong>multiple tags</strong></p>:

[
    {
      children: [{text: 'multiple tags', italic: true, bold: true, underline: true}],
      type: 'paragraph',
    },
  ]

This code sandbox was really helpful in guiding me to serialize and deserialize, but it also does not serialize multiple tags, which we can see when it does console.log(htmlSerialize(plugins)(newValue)). For the "mixed" example, it returns <strong>mixed, </strong>.
My code is pretty much the same as in the sandbox. I also did not find an example in the tests. I don't know what I'm missing. How should I serialize multiple tags applied to the same text?

cc @spetex

Storybook is broken on master / next branches

Hello! I tried pulling down this repo and running the storybook locally, but the build appears to be broken.

This is when running yarn then yarn storybook in the root directory.

yarn: 1.22.4
node: 14.5.0
macOS 10.15.5

Log:

yarn run v1.22.4
$ start-storybook -p 6006
info @storybook/react v5.3.19
info 
info => Loading presets
info => Loading presets
info => Loading custom manager config.
info => Loading config/preview file in "./.storybook".
info => Adding stories defined in ".storybook/main.js".
info => Using default Webpack setup.
info => Using base config because react-scripts is not installed.
webpack built bb9ea818b45bf65081e3 in 65119ms
✖ 「wdm」: Hash: bb9ea818b45bf65081e3
Version: webpack 4.43.0
Time: 65119ms
Built at: 07/17/2020 5:16:23 PM
                                          Asset      Size        Chunks                                Chunk Names
                                    iframe.html  2.87 KiB                [emitted]                     
            main.bb9ea818b45bf65081e3.bundle.js  3.88 MiB          main  [emitted] [immutable]  [big]  main
        main.bb9ea818b45bf65081e3.bundle.js.map  3.35 MiB          main  [emitted] [dev]               main
    runtime~main.bb9ea818b45bf65081e3.bundle.js  33.5 KiB  runtime~main  [emitted] [immutable]         runtime~main
runtime~main.bb9ea818b45bf65081e3.bundle.js.map  34.7 KiB  runtime~main  [emitted] [dev]               runtime~main
    vendors~main.bb9ea818b45bf65081e3.bundle.js  13.8 MiB  vendors~main  [emitted] [immutable]  [big]  vendors~main
vendors~main.bb9ea818b45bf65081e3.bundle.js.map  12.2 MiB  vendors~main  [emitted] [dev]               vendors~main
Entrypoint main [big] = runtime~main.bb9ea818b45bf65081e3.bundle.js runtime~main.bb9ea818b45bf65081e3.bundle.js.map vendors~main.bb9ea818b45bf65081e3.bundle.js vendors~main.bb9ea818b45bf65081e3.bundle.js.map main.bb9ea818b45bf65081e3.bundle.js main.bb9ea818b45bf65081e3.bundle.js.map
[0] multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js ./.storybook/preview.js ./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js ./.storybook/generated-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=true 112 bytes {main} [built]
[./.storybook/generated-entry.js] 2.01 KiB {main} [built]
[./.storybook/preview.js] 563 bytes {main} [built]
[./node_modules/@storybook/addon-docs/blocks.js] 43 bytes {vendors~main} [built]
[./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js] 292 bytes {vendors~main} [built]
[./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js] 672 bytes {vendors~main} [built]
[./node_modules/@storybook/addon-docs/dist/frameworks/react/extractProps.js] 2.21 KiB {vendors~main} [built]
[./node_modules/@storybook/addon-docs/dist/lib/docgen/index.js] 932 bytes {vendors~main} [built]
[./node_modules/@storybook/addon-knobs/dist/index.js] 6.3 KiB {vendors~main} [built]
[./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js] 149 bytes {vendors~main} [built]
[./node_modules/@storybook/client-api/dist/index.js] 3.82 KiB {vendors~main} [built]
[./node_modules/@storybook/core/dist/server/common/polyfills.js] 120 bytes {vendors~main} [built]
[./node_modules/@storybook/core/dist/server/preview/globals.js] 93 bytes {vendors~main} [built]
[./node_modules/@storybook/react/dist/client/index.js] 1.34 KiB {vendors~main} [built]
[./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true] (webpack)-hot-middleware/client.js?reload=true&quiet=true 7.68 KiB {vendors~main} [built]
    + 4516 hidden modules

WARNING in ./packages/slate-plugins/src/deserializers/deserialize-md/withDeserializeMd.ts 18:19-25
"export 'default' (imported as 'marked') was not found in 'marked'
 @ ./packages/slate-plugins/src/deserializers/deserialize-md/index.ts
 @ ./packages/slate-plugins/src/deserializers/index.ts
 @ ./packages/slate-plugins/src/index.ts
 @ ./stories/elements/editable-voids/editable-voids.stories.tsx
 @ ./stories sync ^\.\/(?:(?:|\/|(?:(?:(?!(?:|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(tsx|mdx))$
 @ ./.storybook/generated-entry.js
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js ./.storybook/preview.js ./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js ./.storybook/generated-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=true

ERROR in ./packages/slate-plugins/src/index.ts
Module not found: Error: Can't resolve '@udecode/slate-plugins-core' in '/Users/sallya/Developer/slate-plugins/packages/slate-plugins/src'
 @ ./packages/slate-plugins/src/index.ts 1:0-44 1:0-44
 @ ./stories/elements/editable-voids/editable-voids.stories.tsx
 @ ./stories sync ^\.\/(?:(?:|\/|(?:(?:(?!(?:|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(tsx|mdx))$
 @ ./.storybook/generated-entry.js
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js ./.storybook/preview.js ./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js ./.storybook/generated-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=true
Child HtmlWebpackCompiler:
                          Asset      Size               Chunks  Chunk Names
    __child-HtmlWebpackPlugin_0  6.33 KiB  HtmlWebpackPlugin_0  HtmlWebpackPlugin_0
    Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
    [./node_modules/html-webpack-plugin/lib/loader.js!./node_modules/@storybook/core/dist/server/templates/index.ejs] 2.13 KiB {HtmlWebpackPlugin_0} [built]

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

webpack building...
webpack built 8533373caac8ea8b6718 in 6640ms
✖ 「wdm」: Hash: 8533373caac8ea8b6718
Version: webpack 4.43.0
Time: 6640ms
Built at: 07/17/2020 5:16:33 PM
                                          Asset      Size        Chunks                                      Chunk Names
           bb9ea818b45bf65081e3.hot-update.json  35 bytes                [emitted] [immutable] [hmr]         
                                    iframe.html  2.87 KiB                [emitted]                           
            main.8533373caac8ea8b6718.bundle.js  3.88 MiB          main  [emitted] [immutable]        [big]  main
        main.8533373caac8ea8b6718.bundle.js.map  3.35 MiB          main  [emitted] [dev]                     main
    runtime~main.8533373caac8ea8b6718.bundle.js  33.5 KiB  runtime~main  [emitted] [immutable]               runtime~main
runtime~main.8533373caac8ea8b6718.bundle.js.map  34.7 KiB  runtime~main  [emitted] [dev]                     runtime~main
    vendors~main.8533373caac8ea8b6718.bundle.js  13.8 MiB  vendors~main  [emitted] [immutable]        [big]  vendors~main
vendors~main.8533373caac8ea8b6718.bundle.js.map  12.2 MiB  vendors~main  [emitted] [dev]                     vendors~main
Entrypoint main [big] = runtime~main.8533373caac8ea8b6718.bundle.js runtime~main.8533373caac8ea8b6718.bundle.js.map vendors~main.8533373caac8ea8b6718.bundle.js vendors~main.8533373caac8ea8b6718.bundle.js.map main.8533373caac8ea8b6718.bundle.js main.8533373caac8ea8b6718.bundle.js.map
[0] multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js ./.storybook/preview.js ./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js ./.storybook/generated-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=true 112 bytes {main}
[./.storybook/generated-entry.js] 2.01 KiB {main} [built]
[./.storybook/preview.js] 563 bytes {main}
[./node_modules/@storybook/addon-docs/blocks.js] 43 bytes {vendors~main}
[./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js] 292 bytes {vendors~main}
[./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js] 672 bytes {vendors~main}
[./node_modules/@storybook/addon-docs/dist/frameworks/react/extractProps.js] 2.21 KiB {vendors~main}
[./node_modules/@storybook/addon-docs/dist/lib/docgen/index.js] 932 bytes {vendors~main}
[./node_modules/@storybook/addon-knobs/dist/index.js] 6.3 KiB {vendors~main}
[./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js] 149 bytes {vendors~main}
[./node_modules/@storybook/client-api/dist/index.js] 3.82 KiB {vendors~main}
[./node_modules/@storybook/core/dist/server/common/polyfills.js] 120 bytes {vendors~main}
[./node_modules/@storybook/core/dist/server/preview/globals.js] 93 bytes {vendors~main}
[./node_modules/@storybook/react/dist/client/index.js] 1.34 KiB {vendors~main}
[./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true] (webpack)-hot-middleware/client.js?reload=true&quiet=true 7.68 KiB {vendors~main}
    + 4516 hidden modules

WARNING in ./packages/slate-plugins/src/deserializers/deserialize-md/withDeserializeMd.ts 18:19-25
"export 'default' (imported as 'marked') was not found in 'marked'
 @ ./packages/slate-plugins/src/deserializers/deserialize-md/index.ts
 @ ./packages/slate-plugins/src/deserializers/index.ts
 @ ./packages/slate-plugins/src/index.ts
 @ ./stories/examples/playground.stories.tsx
 @ ./stories/examples sync nonrecursive ^\.\/(?:(?:playground\.stories\.tsx)$)$
 @ ./.storybook/generated-entry.js
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js ./.storybook/preview.js ./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js ./.storybook/generated-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=true

ERROR in ./packages/slate-plugins/src/index.ts
Module not found: Error: Can't resolve '@udecode/slate-plugins-core' in '/Users/sallya/Developer/slate-plugins/packages/slate-plugins/src'
 @ ./packages/slate-plugins/src/index.ts 1:0-44 1:0-44
 @ ./stories/examples/playground.stories.tsx
 @ ./stories/examples sync nonrecursive ^\.\/(?:(?:playground\.stories\.tsx)$)$
 @ ./.storybook/generated-entry.js
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js ./.storybook/preview.js ./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js ./.storybook/generated-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=true

Embeds get re rendered on adding list items in editor

Bug

Description

Whenever we add a nested list item in the list Embed component gets rerendered.

How to reproduce

Visit Slate plugins storybook. add list items right above embed and now add nested list items. embed component gets rerendered and causes another network request.

Expected behavior

If the URL for embed is not changed component should not be re-rendered so we can avoid network request Also, re-render impacts UX.

Bug - Uncaught RangeError: Maximum call stack size exceeded

Has anyone else that uses SlateJS run into this issue?

How to replicate: Type relatively quickly, and once you build up enough text you will notice the cursor start to lag a little bit, keep typing, I find it helps use the delete key.

I am not sure if this is an issue with SlateJS itself, but I was able to replicate it inside of the Storybook editor after discovering the issue during local development.

The app will crash and the error will appear in the console.

Using `getElement` as default prop value causes remount

Current Behavior
Components using getElement to set a default component value in renderElement props will cause the component and child components to remount every onChange.

Expected Behavior
Component and child components should as expected with React.


Took a bit tracking this down. Had a component inside a heading element remounting and couldn't for the life of me figure out why it was.

Resolved by instantiating components outside the default value.

Styling flexibility

Hi @zbeyens . Thanks for the plugin system. I'm happy to use it. The main question right now is about styling flexibility. Is it intended to have it this way (my last question in #81 , or hardcoded Editable style which makes stuff complicated) or PRs are accepted to fix such things?

How to create a new plugin to wrap selected text in a DIV block

Hi I would like to create a plugin using slate-plugins, I would like to achieve the following steps

  1. Select multiple components like list, image, table etc
  2. Wrap around a DIV tag
  3. Give an auto id to that NEW DIV tag
  4. Return the content of that newly created DIV tag, so that I can save in DB
  5. Then next time when I will load the Editor with initial values
  6. Can delete that DIV using toolbar button and call a callback function before deletion.

I am new to this slate and I have gone through many topics but could not able to find a better document for plugin creation.

Could anyone guide me?

Thanks in advance.

setting to italic sets not only selection

Selecting part of the text does not ensure only that part will be modified.
Steps to reproduce:

  1. open the balloon editor example
  2. select the word select with double click (it's already bold)
  3. press the italic button in the balloon editor
  4. All text in that line up until select will be italic

delete in a table

Hello,
I found bug in tablePlugin. Try this steps:

  1. write paragraph "aaa" (value: [{"children":[{"text":"aaa"}]}])
  2. insert table fill text "a" to all cells (value: [{"children":[{"text":"aaa"}]},{"type":"table","children":[{"type":"table-row","children":[{"type":"table-cell","children":[{"text":"a"}]},{"type":"table-cell","children":[{"text":"a"}]}]},{"type":"table-row","children":[{"type":"table-cell","children":[{"text":"a"}]},{"type":"table-cell","children":[{"text":"a"}]}]}]}])
  3. select text and table in first row and cell and press delete now error is dipplayed: Warning: validateDOMNesting(...): cannot appear as a child of
    . (bugy value is: [{"type":"table-cell","children":[{"text":""}]},{"type":"table","children":[{"type":"table-row","children":[{"type":"table-cell","children":[{"text":"a"}]}]},{"type":"table-row","children":[{"type":"table-cell","children":[{"text":"a"}]},{"type":"table-cell","children":[{"text":"a"}]}]}]}] )

Pavel

Search Highlight plugin won't highlight the text of a single node if parts of the text have different marks

Bug

When the text of one node has different marks, then the search highlight won't be able to highlight them.

Steps to reproduce

  • have a sentence's word with bold, then followed by italic (or any marks)
  • search for the said sentence

it'll only highlight from the first mark it matches with.
Searching for beyond that mark will make the search highlight lose track.

search bug

Expected behavior

As long as it's in the same node, it should highlight the entire sentence, regardless of the marks.

paste-md: parse from md to slate

At the moment, this plugin parses twice the content (MD -> HTML -> Slate). it's using marked to parse MD to HTML, and there is a way to parse to Slate directly.

See #74

Table element absurd behaviour on deleting cells [BUG]

When you select "Human" and "Dog" and press the delete button,
Expected result: Human and Dog (Text), get's deleted and Focus on The Anchor of selection
Actual Result: Cell get's deleted, instead of text.

Before:
1 Before

After:
2 After

Cannot get the parent path of the root path []

If you highlight from the middle of the numbered list to the middle of the unordered list then hit backspace, you’ll see an error from Slate that shows this expectation.

Possible solution: the examples are missing a root “document” type node which Slate seems to expect.

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.