[whatwg] Simple Links
christoph.paeper at crissov.de
Tue Jul 27 15:04:57 PDT 2010
> On Tue, 30 Mar 2010, Christoph Päper wrote:
>> I wonder whether HTML could and should provide some sort of similar shortening, i.e. “<a href>Foo</a>” or even, just maybe, “<a>Foo</a>”.
I later came to the conclusion that this might be a nice thing for HTML editors, but not for browsers.
If nothing else, it would probably be abused for comment spam, because there probably are scripts out there that do not filter ‘href’-less ‘a’-elements.
>> The UA would append the string content, properly encoded, to the base Web address as the hyperlink’s target, …
> I (…) couldn't find any pages that matched the pattern <a href="(.+)">$1</a>, …
Um, that’s not exactly what I meant, note “append … to the base Web address”.
These are conversions I had in mind, assuming the location <https://example.com/Bar/baz.html>:
derived href value
<a href>Foo</a> => /Bar/Foo or ./Foo or Foo
<a href>Foo.html</a> => /Bar/Foo.html or ./Foo.html or Foo.html
<a href>Foo.com</a> => /Bar/Foo.com or ./Foo.com or Foo.com
<a href>Foo/</a> => /Bar/Foo/ or ./Foo/ or Foo/
<a href>/Foo</a> => /Foo
<a href>#Foo</a> => #Foo
<a href>/</a> => /
<a href>http://Foo.com</a> => http://foo.com
<a href>://Foo.com</a> => https://foo.com (?)
More information about the whatwg