[pmwiki-users] 'title' attribute of an HTML link
Patrick R. Michaud
pmichaud at pobox.com
Wed Jan 11 09:30:42 CST 2006
On Wed, Jan 11, 2006 at 11:46:00AM +0100, Jean Demartini wrote:
> As all know, the 'title' attribute of an HTML link gives a bubble when
> the mouse is moved over the link. How to define the 'title' attribute of
> the HTML link associated to a PmWiki link ?
>
> A way similar to the way used to define the 'target' attribute could be
> great !
PmWiki already reserves the use of double-quotes to be able to
set the title= attribute for links, as in
http://www.pmichaud.com/toast"Strawberry Pop-Tart Blow Torches"
This is already done for images, but the feature has never really
been fleshed out for links. Also, somehow using WikiStyles for
title= attributes has never felt quite right to me.
One can currently get a close approximation by doing
$UrlLinkFmt =
"<a class='urllink' href='\$LinkUrl' rel='nofollow'
title='\$LinkAlt'>\$LinkText</a>";
and then doing
[[http://www.pmichaud.com/toast("Strawberry Pop-Tart Blow Torches")]]
See http://www.pmwiki.org/wiki/Test/LinkTitle. The double-brackets
and parens are necessary here to prevent the quoted text from
being displayed as part of the link text. Ideally I suppose that
we should fix bare links like
http://www.pmichaud.com/toast"Pop Tarts"
to automatically suppress the display of the quoted title attribute,
so that we get
<a class='urllink' href='http://www.pmichaud.com/toast'
title='Pop Tarts'>http://www.pmichaud.com/toast</a>
and not
<a class='urllink' href='http://www.pmichaud.com/toast'
title='Pop Tarts'>http://www.pmichaud.com/toast"Pop Tarts"</a>
Comments welcome.
Pm
More information about the pmwiki-users
mailing list