brettimus / quill-placeholder

a placeholder text module for use with the quilljs editor
MIT License
8 stars 0 forks source link

I am using this Quill placeholder module but it causes an error with the format key #5

Closed sferoze closed 9 years ago

sferoze commented 9 years ago

Hi.

I had an error where I could not initialize Quill with the format key to specify which formats I support.

With the formats key, it causes Quill to break if I have this module. Jason Chen (maintainer of Quill) said it was your placeholder module.

http://stackoverflow.com/questions/32754515/trying-to-initialize-quill-with-specific-formats-and-getting-an-error

Do you know how we can get this to work with the format key as well?

brettimus commented 9 years ago

Hey I'll look into this. I couldn't reproduce for the last person who encountered this error. Will check again.

brettimus commented 9 years ago

Would you be willing to try using the code on the V1 branch?

https://github.com/brettimus/quill-placeholder/tree/v1

sferoze commented 9 years ago

I just tried it. It does not break the format key anymore but it does not show the placeholder either.

brettimus commented 9 years ago

Hahah well that's an issue of itself.

brettimus commented 9 years ago

I will see what I can do tonight!

sferoze commented 9 years ago

thanks i can test it whenever you let me know

sferoze commented 9 years ago

@brettimus any update?

brettimus commented 9 years ago

had a meeting go late last night - will do some work on it now!

brettimus commented 9 years ago

alright i figured out what's going on. the placeholder module uses the color format by default. because you're only whitelisting bold in your formats list, quill throws an error when formatText is called with a color attribute.

i'll work on a patch!

sferoze commented 9 years ago

Ah cool so are the changes in master? Should I just download the new script from master? I can try it out later tonight and let you know how it works for me

brettimus commented 9 years ago

@sferoze fix is in master and on bower!

i changed the api a little bit more too. no longer necessary to call that onmoduleload initializer. I do that internally now :grin: .

thanks for opening this issue!

sferoze commented 9 years ago

@brettimus THanks will try it out later tonight.

So are you saying I do not need to call this code anymre

@editor.onModuleLoad 'placeholder', (placeholder) ->
    placeholder.initialize()

All I need to do is just include the module when initializing quill?

brettimus commented 9 years ago

yup!

sferoze commented 9 years ago

Hey @brettimus I tried it out few nights ago and I forgot to tell you that it worked great! Thanks for the update, real slick module