Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

img and/or open graph parsing #29

Closed
derekr opened this issue Apr 28, 2015 · 6 comments
Closed

img and/or open graph parsing #29

derekr opened this issue Apr 28, 2015 · 6 comments

Comments

@derekr
Copy link

derekr commented Apr 28, 2015

Understandably not a desired feature, but I appreciate link/og parsing found in apps like slack and hipchat. Happy to work on it, but looking for some feedback on if this is wanted before I spend some time on it.

@max-mapper
Copy link
Member

+1 to gifs/pngs/jpgs for starters

would be nice to have a 'embed-media' module that matched strings for media urls, then turned them into embed html. bonus points if it can verify they are valid images before rendering (e.g. render to invisible canvas and make sure it loads correctly)

@max-mapper
Copy link
Member

since we have markdown now all you need to do is transform .jpg, .png, .gif into ![meta](url)

@derekr
Copy link
Author

derekr commented Apr 28, 2015

Yeah I think that'll work for now. To provide a decent experience like slack (verifying a valid url and what not) message parsing would need be async and was more work than I could put in to it last night haha.

@derekr
Copy link
Author

derekr commented Apr 28, 2015

Thoughts from last night:

message = richMessage(message)

// parse <a> from rendered html
// check for first valid embed (or just grab the first url and if it doesn't work then ¯\_(ツ)_/¯
parseEmbeds(message, cb (err, embed) {
  // embed could share the same structure as a message { text: 'url', html: 'embed html' }
  message = richMessage.mergeMessages(message, embed)
  render()
})
  • Loading/parsing indicator
  • Ensuring embed renders below relevant message and not at the bottom of all merged messages

@Flet
Copy link
Member

Flet commented Apr 30, 2015

This issue was moved to moose-team/rich-message#2

@Flet Flet closed this as completed Apr 30, 2015
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

4 participants