/** * @module plugins/line-height */ import type { IControlType, IJodit } from 'jodit/types'; import { Config } from 'jodit/config'; import { memorizeExec } from 'jodit/core/helpers'; import { Icon } from 'jodit/core/ui/icon'; declare module 'jodit/config' { interface Config { /** * Default line spacing for the entire editor * * ```js * Jodit.make('#editor', { * defaultLineHeight: 1.2 * }) * ``` */ defaultLineHeight: number | null; } } Config.prototype.defaultLineHeight = 2; Icon.set('line-height', require('./line-height.svg')); Config.prototype.controls.lineHeight = { command: 'applyLineHeight', tags: ['ol'], tooltip: 'Line height', list: [1, 1.1, 1.2, 1.3, 1.4, 1.5, 2], exec: (editor, event, { control }): void | false => memorizeExec(editor, event, { control }, (value: string) => value) } as IControlType as IControlType;