Skip to content

Commit

Permalink
Add documentation for getSemanticHTML
Browse files Browse the repository at this point in the history
Closes #3992
  • Loading branch information
luin committed Feb 3, 2024
1 parent d67ec4d commit ba5617e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/website/content/docs/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,25 @@ getText(index: number = 0, length: number = remaining): string
const text = quill.getText(0, 10);
```

### getSemanticHTML

Get the HTML representation of the editor contents.
This method is useful for exporting the contents of the editor in a format that can be used in other applications.

The `length` parameter defaults to the length of the remaining document.

**Methods**

```typescript
getSemanticHTML(index: number = 0, length: number = remaining): string
```

**Examples**

```typescript
const html = quill.getSemanticHTML(0, 10);
```

### insertEmbed

Insert embedded content into the editor, returning a [Delta](/docs/delta/) representing the change. [Source](/docs/api/#events) may be `"user"`, `"api"`, or `"silent"`. Calls where the `source` is `"user"` when the editor is [disabled](#disable) are ignored.
Expand Down
1 change: 1 addition & 0 deletions packages/website/src/data/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const items = [
'getContents',
'getLength',
'getText',
'getSemanticHTML',
'insertEmbed',
'insertText',
'setContents',
Expand Down

0 comments on commit ba5617e

Please sign in to comment.