Skip to content
ФреймворкJavaScript

Курсив: наклонный текст

Wraps selected text in `<i>` (pasted `<em>` is also preserved). Activated with Cmd/Ctrl+I or by clicking the I button in the inline toolbar.

Импорт

TypeScript
import { Italic } from '@bloklabs/core/tools';

Формат данных

TypeScript
// Stored as HTML inside the block's text field.
// "Hello <i>world</i>"
JSON
{
  "type": "paragraph",
  "data": { "text": "Hello <i>world</i>" }
}

Пример использования

TypeScript
import { Blok } from '@bloklabs/core';
import { Italic } from '@bloklabs/core/tools';

const editor = new Blok({
  holder: 'editor',
  tools: {
    italic: Italic,
  },
});