Open howardr opened 11 years ago
Sure passing a block would be fine, we do that here (maybe using this existing block is even a solution): https://github.com/twitter/twitter-text-rb/blob/v1.6.1/lib/twitter-text/autolink.rb#L239
What attributes did you need? Can I have some context?
I am finding it difficult to use different html attributes for different entity types (i.e. url, screen name, entity, cashtag). I have ended up recreating the code here...
https://github.com/twitter/twitter-text-rb/blob/v1.6.1/lib/twitter-text/autolink.rb#L67
...to add type specific attrs. In my specific case, I could work around this by using class names, but was curious if you would accept a patch for type specific attributes? Another solution I was thinking would be passing in a block that gets called in #auto_link_entities to allow for specific attributes to be changed (very basic example below)