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

Commit

Permalink
Fix inline styling
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Aug 11, 2020
1 parent d989283 commit 06e6e6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/marks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Editor, Transforms, Range } from 'slate';
import { Editor, Transforms, Range, Text } from 'slate';

export function isMarkActive(editor, format) {
// TODO: this implementation is not ok. LibreOffice Writer only shows
Expand Down Expand Up @@ -45,7 +45,8 @@ function addMark(editor, key, value) {
}

function isSelectionInline(editor) {
return Editor.isInline(editor, Editor.node(editor, editor.selection));
const [node] = Editor.node(editor, editor.selection || editor.savedSelection);
return Text.isText(node) || Editor.isInline(editor, node);
}

export function toggleMark(editor, format) {
Expand Down

0 comments on commit 06e6e6f

Please sign in to comment.