KillerCodeMonkey / ngx-quill

Angular (>=2) components for the Quill Rich Text Editor
MIT License
1.79k stars 264 forks source link

How can I stop links without protocols #1684

Closed Et3rnal closed 1 year ago

Et3rnal commented 1 year ago

Is there a simple way to stop or validate links?

As soon as I try import Quill and reference it I keep getting undefined error: quill_1.default is undefined

import Quill from 'quill';
var Link = Quill.import('formats/link');

I tried to use the onContentChanged() event to validate but I'm not able to stop the user

KillerCodeMonkey commented 1 year ago

in my example repo i am importing things like that and it is working:

https://github.com/KillerCodeMonkey/ngx-quill-example/blob/master/src/app/app.component.ts#L5

you can try to deactivate the link format and implement you own.

and in general i would store the editor content as object/json format. there you get the content and format of the link when the editor content changes, and it is very easy change it