Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Missing link_attribute_transform functionality? #26

Closed
abhillman opened this issue Apr 29, 2014 · 1 comment
Closed

Missing link_attribute_transform functionality? #26

abhillman opened this issue Apr 29, 2014 · 1 comment

Comments

@abhillman
Copy link

Steps to reproduce:

import twitter_text
text = 'http://www.google.com'
def link_attribute_transform(entity, attributes):
   import pdb; pdb.set_trace()
   return attributes
twitter_text.Autolink(text).auto_link_entities(entities=twitter_text.Extractor(text).extract_urls_with_indices(), options={'link_attribute_transform': link_attribute_transform})

... and the link_attribute_transform method is not called!

@abhillman
Copy link
Author

Looks like this is due to a typo in autolink.py...

-        if options.get('link_attributes_transform'):
-            attributes = options.get('link_attributes_transform')(entity, attributes)
+        if options.get('link_attribute_transform'):
+            attributes = options.get('link_attribute_transform')(entity, attributes)
         text = options.get('link_text_transform', default_transform)(entity, text)

... have submitted a pull request.

@dryan dryan closed this as completed May 6, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants