Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
Simplify registration of new element
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Sep 6, 2020
1 parent ae5fddb commit 0bd4a01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/blocks/Text/TextBlockEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ const TextBlockEdit = (props) => {
[defaultSelection, block, saveSlateBlockSelection],
);

console.log('render', block);
return (
<>
<SidebarPortal selected={selected}>
Expand Down
3 changes: 1 addition & 2 deletions src/components/ElementEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const makeInlineElementPlugin = (options) => {
toolbarButtonIcon: tagSVG,
title,
extensions: [],
elements: {},
// editSchema,

// A generic "validation" method, just finds that a "positive" value
Expand Down Expand Up @@ -57,7 +56,7 @@ export const makeInlineElementPlugin = (options) => {
...(slate.extensions || []),
...pluginOptions.extensions,
];
slate.elements = { ...slate.elements, ...pluginOptions.elements };
slate.elements[elementType] = options.element;
slate.nodeTypesToHighlight.push(elementType);

// The plugin authors should manually add the button to the relevant toolbars
Expand Down

0 comments on commit 0bd4a01

Please sign in to comment.