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

img link in 'a href' #33

Closed
Alir3z4 opened this issue Oct 4, 2014 · 6 comments
Closed

img link in 'a href' #33

Alir3z4 opened this issue Oct 4, 2014 · 6 comments
Labels

Comments

@Alir3z4
Copy link
Owner

Alir3z4 commented Oct 4, 2014

@dvasseur The following html code

<a href="http://google.com"><img src="images/google.png" alt="Go to google"></a>

is converted to [Go to google](images/google.png)
I would have prefered, [Go to google](http://google.com)

can this be done ?


@szepeviktor: This is so in Markdown:
Go to google

[![Go to google](images/google.png)](http://google.com)

@Alir3z4 Hmm, this is interesting actually:

In [2]: html2text.html2text('<a href="http://google.com"><img src="images/google.png" alt="Go to google"></a>')
Out[2]: u'![Go to google](images/google.png)\n\n'

Sure it has its own downside, but I would like to have base hostname in the image src too.


@szepeviktor: So the <a> element is completely stripped out?


@Alir3z4: That's another issue here and yes the a tag is gone here


@mcepl: Just for reference http://daringfireball.net/projects/markdown/syntax#img


Note: Extracted from an old repo.

@Alir3z4 Alir3z4 added the bug label Oct 4, 2014
@szepeviktor
Copy link
Contributor

@Alir3z4 Do you plan to make steps in this direction?

@Alir3z4
Copy link
Owner Author

Alir3z4 commented Dec 26, 2014

@szepeviktor No I don't, but any patch is welcome for this bug.
Although maybe #49 is a workaround for this issue, lemme know about it

@szepeviktor
Copy link
Contributor

Has it been solved now?

@szepeviktor
Copy link
Contributor

😄 Yes it does work.

<a href="http://google.com"><img src="images/google.png" alt="Go to google"></a>
[![Go to google](images/google.png)](http://google.com)

@szepeviktor
Copy link
Contributor

@Alir3z4 Please close it.

@Alir3z4
Copy link
Owner Author

Alir3z4 commented Mar 21, 2015

@szepeviktor Thanks for the update and follow up on this issue.
I'll close now.

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

No branches or pull requests

2 participants