[TOC]
## find <span class="experimental">实验</span>
<!--
Static method returning the Quill or [Blot](https://github.com/quilljs/parchment) instance for the given DOM node. In the latter case, passing in true for the `bubble` parameter will search up the given DOM's ancestors until it finds a corresponding [Blot](https://github.com/quilljs/parchment).
-->
静态方法,给定一个DOM节点,返回对应的Quill或<a href="https://github.com/quilljs/parchment" target="_blank">Blot</a>实例。
返回后者时,参数`bubble`为true时,将向上搜索给定DOM的祖先节点,知道找到对应的<a href="https://github.com/quilljs/parchment" target="_blank">Blot</a>。
**方法**
```javascript
Quill.find(domNode: Node, bubble: boolean = false): Blot | Quill
```
**示例**
```javascript
var container = document.querySelector("#container");
var quill = new Quill(container);
console.log(Quill.find(container) === quill); // Should be true
quill.insertText(0, 'Hello', 'link', 'https://world.com');
var linkNode = document.querySelector('#container a');
var linkBlot = Quill.find(linkNode);
```
## getIndex <span class="experimental">实验</span>
<!--
Returns the distance between the beginning of document to the occurrence of the given [Blot](https://github.com/quilljs/parchment).
-->
返回文档开始至给定<a href="https://github.com/quilljs/parchment" target="_blank">Blot</a>对象位置的距离。
**方法**
```javascript
getIndex(blot: Blot): Number
```
**示例**
```javascript
let [line, offset] = quill.getLine(10);
let index = quill.getIndex(line); // index + offset should == 10
```
## getLeaf <span class="experimental">实验</span>
<!--
Returns the leaf [Blot](https://github.com/quilljs/parchment) at the specified index within the document.
-->
指定文档中的距离,返回对应的叶<a href="https://github.com/quilljs/parchment" target="_blank">Blot</a>实例。
**方法**
```javascript
getLeaf(index: Number): Blot
```
**示例**
```javascript
quill.setText('Hello Good World!');
quill.formatText(6, 4, "bold", true);
let [leaf, offset] = quill.getLeaf(7);
// leaf should be a Text Blot with value "Good"
// offset should be 1, since the returned leaf started at index 6
```
## getLine
<!--
Returns the line [Blot](https://github.com/quilljs/parchment) at the specified index within the document.
-->
指定文档中的距离,返回行 <a href="https://github.com/quilljs/parchment" target="_blank">Blot</a>。
**方法**
```javascript
getLine(index: Number): [Blot, Number]
```
**示例**
```javascript
quill.setText('Hello\nWorld!');
let [line, offset] = quill.getLine(7);
// line should be a Block Blot representing the 2nd "World!" line
// offset should be 1, since the returned line started at index 6
```
## getLines <span class="experimental">实验</span>
<!--
Returns the lines contained within the specified location.
-->
返回指定位置包含的行。
**方法**
```javascript
getLines(index: Number = 0, length: Number = remaining): Blot[]
getLines(range: Range): Blot[]
```
**示例**
```javascript
quill.setText('Hello\nGood\nWorld!');
quill.formatLine(1, 1, 'list', 'bullet');
let lines = quill.getLines(2, 5);
// array witha a ListItem and Block Blot,
// representing the first two lines
```
- 前言
- 快速开始(quick_start)
- 下载(download)
- 配置(configuration)
- 格式(formats)
- API
- 内容(contents)
- 格式化(formatting)
- 选区(selection)
- 编辑器(editor)
- 事件(events)
- 模型(model)
- 扩展(extension)
- 增量(Delta)
- 模块(modules)
- 工具栏(toolbar)
- 键盘(keyboard)
- 历史记录(history)
- 粘贴板(clipboard)
- 语法高亮(syntax)
- 主题(themes)
- 更多教程
- 为什么选择Quill?
- 如何定制Quill?
- 设计Delta格式(未翻译)
- 构建一个自定义模块
- 将Quill加入你的编译管线(未翻译)
- Cloning Medium with Parchment
- 和其它富文本编辑器的对比(未翻译)
- Designing the Delta Format
- 扩展模块
- vue-quill-editor
- quill-image-extend-module
- quill-image-resize-module
- quill-image-drop-module
- quill-better-table
- quilljs-table
- 更多模块