4 ms·
My guess is that the html formatter changed the text "example.com" into "http://example.com http://example.com" to make it a valid absolute URL.
by silvestrov 2y ago
My guess is that the html formatter changed the text "example.com" into "http://example.com http://example.com" to make it a valid absolute URL.
- chrismorgan 2y agoAnything that turns </example.com/> into <http://example.com/ http://example.com/> should be shot. I dislike automatic linkifiers, especially in technical contexts, because they get things wrong so often, as regards what is a link at all (and certainly never linkify if there’s no protocol! “example.com/foo” should not be turned into <http://example.com/foo http://example.com/foo>), and as regards what can be part of the link (largely around trailing punctuation). Just require explicit delimition, like <…>, or else it’s text. (Markdown’s […](…) is bad because ) is part of URL code points, meaning parentheses in URLs won’t be percent-encoded by a normal serialiser, so then its parser gets messy trying to compensate, assuming that parentheses will normally be paired in URLs. Your delimiter needs to not be part of the set of URL code points.) HN’s auto-linkifier is, most of the time, one of the better ones (it was bad ten years ago, but got fixed around punctuation inclusion a few years ago), but it still has problems. I noticed too late that it mangled something in my comment: where you get http://xn--ivg http://xn--ivg, that xn--ivg is ”, because what I actually wrote was … too, “http://” but not …