ФреймворкJavaScript
Курсив: наклонный текст
Оборачивает выделенный текст в <i> (вставленный <em> тоже сохраняется). Включается сочетанием Cmd/Ctrl+I или кнопкой I на строчной панели инструментов.
Импорт
TypeScript
import { Italic } from '@bloklabs/core/tools';Формат данных
TypeScript
// A mark on a run of the block's text field:
// { "text": "world", "marks": { "italic": true } }JSON
{
"type": "paragraph",
"data": {
"text": [{ "text": "Hello " }, { "text": "world", "marks": { "italic": true } }]
}
}Пример использования
TypeScript
import { Blok } from '@bloklabs/core';
import { Italic, Paragraph } from '@bloklabs/core/tools';
const editor = new Blok({
holder: 'editor',
tools: {
// Paragraph is the default block and is not bundled with the core —
// without it the editor starts with an "unsupported block" stub.
paragraph: Paragraph,
italic: Italic,
},
});