superlistapp / super_editor

A Flutter toolkit for building document editors and readers
https://superlist.com/SuperEditor/
MIT License
1.67k stars 245 forks source link

Proposal: `StableTagPlugin` should allow multiple tag types #1466

Open kekland opened 1 year ago

kekland commented 1 year ago

Hi!

I wanted to try to use the new StableTagPlugin to replace my somewhat messy plugin for handling mentions in the editor. However, it seems like it doesn't support using two different tag/mention types. In our app, we allow the users to mention other users (via the @ symbol), and hashtags (via the # symbol). Trying to use two instances of StableTagPlugin breaks everything.

I tried to retrofit a solution that would allow two instances of StableTagPlugin to co-exist with eachother, but I couldn't really get it to work.

This will probably require a large rewrite of some of the functions that act upon tags, so I'm not sure about this idea's feasibility. But currently we're still sticking to my messy plugin to handle stable tags :P

matthew-carroll commented 1 year ago

In general, we probably should make it possible to use different triggers for stable tags.

With regard to your specific use-case, are your hash tags truly stable tags? We also have a pattern tag plugin, which was designed around typical hash tag usage. Let me know if you're able to use a single stable tag plugin with a single pattern tag plugin to meet your needs.

matthew-carroll commented 10 months ago

@kekland did you get a chance to try my comment above?