Every extension
lineHeight
Line height as an attribute on existing blocks.
Built the way alignment is: the attribute is declared here and lands on every type named, so a paragraph that knows nothing about line height still keeps, renders and parses it. The document stores the value it was given (`1.5`, `24px`) and the element gets `style="line-height: …"` — after the value has been checked, on the way in and on the way out alike.
editor.commands.setLineHeight(1.5)
editor.commands.setLineHeight('28px')
editor.commands.unsetLineHeight()
Adding it
import { createEditor, document, paragraph, text, lineHeight } from '@matrajs/core'
const editor = createEditor({
extensions: [document, paragraph, text, lineHeight({ … })],
element: document.querySelector('#editor'),
})
There is no separate package · lineHeight is already in @matrajs/core, and an extension you do not import is not in your bundle. document, paragraph and text are the floor every document needs.
Commands
-
editor.commands.setLineHeight() -
editor.commands.unsetLineHeight()