From 31e456acd944170956ff4a75cdc4331393ed41af Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 17 Apr 2017 20:54:04 -0700 Subject: [PATCH 1/2] Add guide for customizing built-in formats - https://github.com/quilljs/quill/issues/1107 --- docs/guides/customizing-builtin-formats.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/guides/customizing-builtin-formats.md diff --git a/docs/guides/customizing-builtin-formats.md b/docs/guides/customizing-builtin-formats.md new file mode 100644 index 0000000000..bfb70cdfbb --- /dev/null +++ b/docs/guides/customizing-builtin-formats.md @@ -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; +}; +``` From 35a386fcd3fade706456fafe8f1fc541315b248e Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 17 Apr 2017 20:57:04 -0700 Subject: [PATCH 2/2] add custom formats guide to navigation --- docs/_data/guides.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/_data/guides.yaml b/docs/_data/guides.yaml index 4254a37f20..1a398fbaf9 100644 --- a/docs/_data/guides.yaml +++ b/docs/_data/guides.yaml @@ -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