---
title: "Инструмент «Код в строке» — моноширинный код"
description: "Помечает выделение как код в строке по Cmd/Ctrl+E и сохраняет соответствующую разметку в текстовом поле блока."
source: https://blokeditor.com/ru/docs/inlineCode/
lastmod: 2026-10-07
---

Фреймворк JavaScript

Строчные инструменты Строчный код

# Код в строке: моноширинные фрагменты

Оборачивает выделенный текст в `<code>`. Включается сочетанием Cmd/Ctrl+E или кнопкой кода на строчной панели инструментов. Удобно для имён переменных, вызовов функций и коротких фрагментов кода внутри текста.

### Импорт

TypeScript

```
import { InlineCode } from '@bloklabs/core/tools';
```

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

TypeScript

```
// A mark on a run of the block's text field:
// { "text": "getData()", "marks": { "code": true } }
```

JSON

```
{
  "type": "paragraph",
  "data": {
    "text": [
      { "text": "Call " },
      { "text": "getData()", "marks": { "code": true } },
      { "text": " to fetch results" }
    ]
  }
}
```

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

TypeScript

```
import { Blok } from '@bloklabs/core';
import { InlineCode, 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,
    inlineCode: InlineCode,
  },
});
```
