Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto parse image links #293

Closed
majimboo opened this issue Mar 3, 2015 · 4 comments
Closed

Auto parse image links #293

majimboo opened this issue Mar 3, 2015 · 4 comments

Comments

@majimboo
Copy link

majimboo commented Mar 3, 2015

Is there a builtin function to auto parse image links and turn them into image markup?

@cebe
Copy link
Contributor

cebe commented Mar 3, 2015

what is an "image link"?

@naNuke
Copy link
Contributor

naNuke commented Mar 3, 2015

There isnt, but you can modify the automatic link detection via extension, parse the url to see if its .jpg / .png or whatever images you want and change the resulting tag into instead of

@majimboo
Copy link
Author

majimboo commented Mar 3, 2015

@cebe what @naNuke said. Thanks, I guess I'll just write the extension. Any documentation in writing the extension?

@naNuke
Copy link
Contributor

naNuke commented Mar 3, 2015

@majimboo https://github.com/erusev/parsedown/wiki/Writing-Extensions

all you need to do is to rewrite original function which parses inline links, call parent function of same name, catch the result, and if its an array, change the resulting element key from a to img and parameter href to src. :)

@majimboo majimboo closed this as completed Mar 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants