ichord / At.js

Add Github like mentions autocomplete to your application.
http://ichord.github.com/At.js
MIT License
5.3k stars 668 forks source link

Option to customize the wrapper for the inserted html? #545

Open jonathanrbowman opened 6 years ago

jonathanrbowman commented 6 years ago

Thanks for a great library!

When inserting a selection it gets wrapped in a span, like:

<span class="atwho-inserted" data-atwho-at-query="@jonny" contenteditable="false">@jonny_appleseed</span>

Is there not an option to customize this? I can change what goes inside of it, but I'd rather change it so the data-atwho-at-query is equal to another piece of the data, like the user's ID. Right now, if I edit theinsertTpl to be something like:

 "<span data-mentioned-user='${id}'>@${name}</span>"

it puts it inside of the other span, which is OK but not ideal. Does this make sense? Did I just miss it in the documentation?

Thanks!

loutocky commented 6 years ago

+1

I am also looking for something to config inserted selection. Because now I am clearing inserted text from html class, which I dont need in this case.