simian 0.1.1

A command-line tool for exploring and implementing Machine Learning algorithms in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
import { Editor } from 'slate'

import { MarkId } from '../types'

export function toggleMark(editor: Editor, mark: MarkId) {
  const marks = Editor.marks(editor)

  if (marks && marks[mark]) {
    Editor.removeMark(editor, mark)
  } else {
    Editor.addMark(editor, mark, true)
  }
}