appdotnet / api-spec

App.net API Documentation is on the web at https://developers.app.net. Source for these docs is in the new-docs branch here. Please use the issue tracker and submit pull requests! Help us build the real-time social service where users and developers come first, not advertisers.
https://developers.app.net
950 stars 98 forks source link

Should be a way to indicate extra text added by App.net in a post #230

Closed beccadax closed 11 years ago

beccadax commented 12 years ago

When you create a post with embedded link attributes, App.net inserts a domain name in square brackets into the text. There's no way to tell this artificially-injected text from the text the user provided; without that knowledge, clients can't reliably style this text differently or generate a new post based on the text of an existing one (for example, quoting a post).

It'd be helpful if post objects included enough information to reconstruct the unaltered text and entities. I can think of a few approaches:

  1. A new entity type that would mark artificially-added parts of the text. (This could also be used to mark the prefix on reposts.)
  2. A parallel set of pos/len attributes in link entities indicating the area of added text.
  3. A flag on the post indicating whether the link attributes in it were provided by the poster or generated by App.net. Clients could then manually scan for the domain names.
  4. A separate, unaltered copy of the text and entities embedded in the post.
mattflaschen commented 12 years ago

This same issue applies to description (which now supports custom links as well). Of course, editing the description repeatedly is common, and requires stringifying (in Noodle's case to Markdown) and parsing back and forth.

Until this is in place, we will need to all write our own regexes or equivalent to strip the bracket parts ourselves.

I can make a separate issue for description if desired.

orianmarx commented 11 years ago

I agree this is a bit of an issue and also needs to be handled better in the documentation as we are okay with you stripping out this additional text if there are other anti-phishing techniques in place in your app (say showing the url in a "footnote" or on rollover).

mthurman commented 11 years ago

We just rolled out the amended_len property for links that should take care of this use case http://developers.app.net/docs/meta/entities/#links