mindroute / quill-autoformat

Module for formatting and transforming text as you type in Quill
MIT License
67 stars 10 forks source link

Custom Transforms #5

Open Xsmael opened 4 years ago

Xsmael commented 4 years ago

Hello, It's not clear in the docs how to use custom transforms, I'm using quill and I want to add tags right in the text. Or lets say I want to change the design of hashtags and instead of the link appearance I want them bold, color white with a dark background-color <strong style="...">myTagWithoutHash</strong> and also the # to be removed.

How should I go about this ?

klasjersevi commented 4 years ago

The easiest thing would be for you to just modify and customize the hashtag-format to present it any way you like.

Take a look at https://github.com/Weavy/quill-autoformat/blob/master/src/formats/hashtag.js

You'll find Parchment docs on how to work with format blots (link example) at https://github.com/quilljs/parchment/#example