Skip to content

Commit

Permalink
chore(lint): clean up markdown control
Browse files Browse the repository at this point in the history
  • Loading branch information
tech4him1 committed Aug 1, 2018
1 parent cb90917 commit 8ad9d42
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default class Editor extends React.Component {
handleBlockClick = (event, type) => {
event.preventDefault();
let { value } = this.state;
const { document: doc, selection } = value;
const { document: doc } = value;
const { unwrapList, wrapInList } = EditListConfigured.changes;
let change = value.change();

Expand Down Expand Up @@ -178,9 +178,8 @@ export default class Editor extends React.Component {


handleDocumentChange = debounce(change => {
const { onChange, getEditorComponents } = this.props;
const { onChange } = this.props;
const raw = change.value.document.toJSON();
const plugins = getEditorComponents();
const markdown = slateToMarkdown(raw);
onChange(markdown);
}, 150);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function onKeyDown(event, change) {
* If the selected block is the first block in the document, create the
* new block above it. If not, create the new block below it.
*/
const { document: doc, range, anchorBlock, focusBlock } = change.value;
const { document: doc, anchorBlock, focusBlock } = change.value;
const singleBlockSelected = anchorBlock === focusBlock;
if (!singleBlockSelected || !focusBlock.isVoid) return;

Expand All @@ -45,7 +45,7 @@ function onKeyDown(event, change) {
[ '`', 'code' ],
];

const [ markKey, markName ] = marks.find(([ key ]) => isHotkey(`mod+${key}`, event)) || [];
const [ , markName ] = marks.find(([ key ]) => isHotkey(`mod+${key}`, event)) || [];

if (markName) {
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function transform(node) {
* they were text is a bit of a necessary hack.
*/
function combineTextAndInline(nodes) {
return nodes.reduce((acc, node, idx, nodes) => {
return nodes.reduce((acc, node) => {
const prevNode = last(acc);
const prevNodeLeaves = get(prevNode, 'leaves');
const data = node.data || {};
Expand Down

0 comments on commit 8ad9d42

Please sign in to comment.