Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guide for customizing built-in formats #1411

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/_data/guides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
url: /guides/adding-quill-to-your-build-pipeline/
- title: Building a Custom Module
url: /guides/building-a-custom-module/
- title: Customizing Built-In Formats
url: /guides/customizing-built-in-formats
- title: Cloning Medium with Parchment
url: /guides/cloning-medium-with-parchment/
- title: Designing the Delta Format
Expand Down
19 changes: 19 additions & 0 deletions docs/guides/customizing-builtin-formats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
layout: docs
title: Customizing Built-in Formats
permalink: /guides/customizing-built-in-formats/
---

Default behavior can be changed or overriden by customizing Quill's [built-in formats](https://github.com/quilljs/quill/tree/develop/formats). All formats, built-in or custom, are implemented in [Parchment](https://github.com/quilljs/parchment/).

### Examples

#### Changing the [link sanitizer](https://github.com/quilljs/quill/blob/develop/formats/link.js)

```js
var Link = Quill.import('formats/link');
Link.sanitize = function(url) {
// change / sanitize url
return url;
};
```