Comments (16)
Just started using this. working on it.
from html2text.
@Alir3z4 @barsch Am I right in assuming that
<a href="http://www.test.com">http://www.test.com</a>
should give me
[http://www.test.com](http://www.test.com)
I am a little new to markdown.
from html2text.
@theSage21 That is correct, <a href="http://www.test.com">http://www.test.com</a>
should give [http://www.test.com](http://www.test.com)
from html2text.
@Alir3z4 Also. Should I add some documentation? As a non English speaker this repo was very confusing to me initially. Docs would have helped.
from html2text.
@theSage21 Sure, that would be great.
You can have #39 this one as well if you like.
from html2text.
@Alir3z4 Al right. I will try to fix this then #39
from html2text.
Awesome ;)
On Sun, May 31, 2015 at 1:31 PM, arjoonn sharma [email protected]
wrote:
@Alir3z4 https://github.com/Alir3z4 Al right. I will try to fix this
then #39 #39—
Reply to this email directly or view it on GitHub
#61 (comment).
from html2text.
This bug This is triggered whenever the text matches the url and it is an absolute url.
It seems this is deliberate. Lines 698 to 701
Removing that condition fixes it. I am not sure if this is a requirement of markdown or not. @Alir3z4 @barsch . Is this a bug or feature? Daring Fireball is silent on these types of links and nobody on IRC seems to know.
from html2text.
@Alir3z4 @barsch This is not a bug. The test/url-escaping.md specifically tests this functionality. I recommend that this issue be closed.
from html2text.
Is <http://www.test.com>
a valid Markdown syntax for an inline link?
http://daringfireball.net/projects/markdown/syntax#link states:
Markdown supports two style of links: inline and reference.
In both styles, the link text is delimited by [square brackets].
However there is an example further down using angle brackets for a referenced link:
[id]: <http://example.com/> "Optional Title Here"
from html2text.
@barsch I am not sure about the proper format. Daring Fireball says nothing about automatic links.
In the tests directory the url-escaping.md file has
* Use automatic links like <http://example.com/> when the URL is the label
Since this type of conversion has been specifically tested I think it was intended to be a feature.
Also notice that
<a href="http://www.test.com">http://www.test.com</a>
<a href="http://www.test.com/">http://www.test.com/</a>
both translate validly to:
<http://www.test.com>
<http://www.test.com/>
Hence whenever the href is absolute and is the same as the text the format of <http://text>
is used.
from html2text.
@barsch @Alir3z4 How about we add a config parameter which is by default left to use automatic links but can be set to translate these types of links to normal Markdown? I think that is a good idea since people can configure as they wish then and people already depending on this module can go on undisturbed.
from html2text.
@theSage21 I like the idea of having config for those kind of link. is --reference-link
option does it ?
from html2text.
@Alir3z4 Sorry, just noticed it. Yes --reference-link
does it.
from html2text.
@theSage21 So this issue can be closed if we consider --reference-link
as the solution ?
from html2text.
@Alir3z4 Yes. The issue can be closed. Automatic links are now optional via the --reference-link
option.
from html2text.
Related Issues (20)
- Cannot provide space between content of <option> tag in <select>
- The export format is incorrect when the table tag contains < p > or < br >
- Featurerequest: Output without markdown HOT 3
- RE_MD_DASH_MATCHER does not exist in the HTML2TEXT() object
- Character reference replacement results in raw HTML
- Broken Images in README.md HOT 2
- How can I parse the `<pre>` tag into tri-backquote style?
- [Bug] Assumes first row is always table header even if it is not HOT 1
- --ignore-links flag creates new composite words in output
- Link titles break with encoded quote
- Ignoring some elements
- HTML <picture> Element not returned as image link from srcset
- charref() maybe throw OverflowError: Python int too large to convert to C int HOT 1
- Extra "\" slashes before specific numeric
- `.handle()` w/ new text yields previous results if AssertionError is raised
- Considered using the rust library html2text under the hood? HOT 1
- <img src> fails assert
- Space missing before links inside <b> tag
- Two backslashes gets converted to 3 backslashes
- Extra space after a closing emphasis mark HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html2text.