# @eyea/plugin-paintformat

> 格式刷插件

Latest version **2.7.30** (published 2022-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @eyea/plugin-paintformat
pnpm add @eyea/plugin-paintformat
yarn add @eyea/plugin-paintformat
bun add @eyea/plugin-paintformat
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.7.30 |
| Published | 2022-02-18 |
| First published | 2022-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 974 |
| Author | me@aomao.com |
| Maintainers | eyea |

## Links

- npm: https://www.npmjs.com/package/@eyea/plugin-paintformat
- Repository: https://github.com/yanmao-cc/am-editor
- Homepage: https://github.com/yanmao-cc/am-editor#readme
- Issues: https://github.com/yanmao-cc/am-editor/issues
- npm.io page: https://npm.io/package/@eyea/plugin-paintformat

## Dependencies (2)

- [@aomao/engine](https://npm.io/package/@aomao/engine.md) ^2.7.30
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.13.10

## Recent versions

- 2.7.30 (latest) — 2022-02-18

## README

# @aomao/plugin-paintformat

格式刷插件

支持所有 mark 标签插件

block 支持以下插件：`@aomao/plugin-heading` `@aomao/plugin-orderlist` `@aomao/plugin-unorderedlist`

## 安装

```bash
$ yarn add @aomao/plugin-paintformat
```

添加到引擎

```ts
import Engine, { EngineInterface } from '@aomao/engine';
import Paintformat from '@aomao/plugin-paintformat';

new Engine(...,{ plugins:[Paintformat] })
```

## 可选项

### 移除

移除样式命令，或提供方法。默认为 removeformat ，需要添加 `@aomao/plugin-removeformat` 插件

```ts
removeCommand?:string | ((range:RangeInterface) => void);
```

### 绘制

如何绘制 block 节点，返回 false，不执行内置绘制，包括不复制 block 节点的 css 样式

```ts
/**
 * @param currentBlock 当前需要绘制的节点
 * @param block 需要被复制格式的节点
 * */
paintBlock?:(currentBlock:NodeInterface,block:NodeInterface) => boolean | void
```

## 命令

```ts
//使用 command 执行插件
engine.command.execute('paintformat');
//使用 command 执行查询当前状态，返回 boolean
engine.command.queryState('paintformat');
```

---
_Source: https://npm.io/package/@eyea/plugin-paintformat · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
