indieweb-utils
indieweb-utils copied to clipboard
`autolink_tags` function should return substitutions made
The autolink_tags
function presently returns the text provided with substitutes for all tags and person tags made. I think this function should also return:
- A list of tags (i.e. #coffee) that were substituted.
- A list of person tags (i.e. @jane) that were substituted.
In my static site generator, I use the list of person tags found to add a "People tagged in this article" section to my website. This would not be possible with the autolink_tags
function as is because the function only returns the substituted text.
Posting interfaces may also need to retrieve a list of tags for internal reference (i.e. if tags are kept in a metadata field).