memspace / zefyr

Soft and gentle rich text editing for Flutter applications.
https://zefyr-editor.gitbook.io
2.22k stars 550 forks source link

Feature request: Allow multiple parameters for one attribute #37

Open ttlg opened 6 years ago

ttlg commented 6 years ago

As I am working on an app for web contents, I want multiple parameters for one attributes, e.g. target="_blank" for the link attribute. Do you have any ideas on how I archive that or have any plan for this feature ? Thank you.

pulyaevskiy commented 6 years ago

Short answer is that it is currently not supported to have multiple parameters on link attributes.

However if you only need those additional attributes in your HTML and they are static like target="_blank" then nothing stops you from adding those when converting Delta to HTML.

I'd be curious to hear more details on your use case to better understand it though.

ttlg commented 6 years ago

Thank you for your reply!

Yes. Your suggestion works if the parameter is static. I’m thinking to use Zefyr as editor for the blog post client like WordPress, and its better to have capability of handling multiple parameters.

pulyaevskiy commented 6 years ago

Thanks for the details. Technically it is possible, though at this point it would be a breaking change to the way link attribute is stored in Notus currently (probably should be able to handle it gracefully though).

Wondering if you could list all the additional attributes you were thinking links should support, aside from target attribute?

ttlg commented 6 years ago

For the link attribute, I think it has few parameters which should be handle in Zefyr aside from target parameter. However I need to handle any parameters for HTML attributes. So instead of adding additional parameters to the attributes, implementing container attribute which stores any parameters would be really helpful for me. In this way, we can preserve any information to the container attribute regardless of whether ZefyrEditor view will reflect the parameters or not.

pulyaevskiy commented 6 years ago

OK, I see now.

Not sure if I'm a big fan of arbitrary containers, but I can see how this may be useful. In any case this would be a substantial change to how things work at this point, will require some careful planning and design.

One interesting area that this or similar functionality would open up is the ability to allow users to completely customize the editor appearance and behavior.

ttlg commented 6 years ago

True. It might be relate to #30. I look forward development of the Zefyr. Thank you for your consideration.