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

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Aug 26, 2020
1 parent 5728544 commit ba95e06
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
5 changes: 2 additions & 3 deletions src/editor/config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,8 @@ export const htmlTagsToSlate = {
UL: blockTagDeserializer('ul'),
LI: blockTagDeserializer('li'),

// B: bTagDeserializer,
// B: blockTagDeserializer('b'), // TODO: reuse bTagDeserializer
B: bTagDeserializer, // TODO: reuse bTagDeserializer
// B: blockTagDeserializer('b'),
B: bTagDeserializer,
STRONG: blockTagDeserializer('strong'),
CODE: inlineTagDeserializer({ code: true }),
DEL: blockTagDeserializer('s'),
Expand Down
2 changes: 2 additions & 0 deletions src/editor/decorate.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@ export function highlightSelection(editor, [node, path], ranges) {
}
}
}
// if (ranges.length) console.log('RANGES!', ranges);
// console.log(node, path, editor.savedSelection);
return ranges;
}
11 changes: 1 addition & 10 deletions src/editor/render.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ export const Element = ({ element, ...rest }) => {
};

export const Leaf = ({ children, ...rest }) => {
const {
attributes,
leaf,
mode,
// text,
// path,
// editor,
} = rest;
const { attributes, leaf, mode } = rest;
let { leafs } = settings.slate;

children = Object.keys(leafs).reduce((acc, name) => {
Expand Down Expand Up @@ -76,7 +69,6 @@ export const serializeNodes = (nodes) => {
path={path}
leaf={node}
text={node}
attributes={{ 'data-slate-leaf': true }}
mode="view"
key={path}
>
Expand All @@ -87,7 +79,6 @@ export const serializeNodes = (nodes) => {
editor={editor}
path={path}
element={node}
attributes={{ 'data-slate-node': 'element', ref: null }}
mode="view"
key={path}
>
Expand Down

0 comments on commit ba95e06

Please sign in to comment.