[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
- 更多模塊