+# This function produces an anchor.
+#
+# arguments:
+# $name : anchor name
+# $href : anchor href
+# text : text displayed
+# extra_attribs : added to anchor attributes list
+sub lilypond_anchor($;$$$)
+{
+ my $name = shift;
+ my $href = shift;
+ my $text = shift;
+ my $attributes = shift;
+ $href = remove_unneeded_anchor($href);
+ if (!defined($attributes) or ($attributes !~ /\S/))
+ {
+ $attributes = '';
+ }
+ else
+ {
+ $attributes = ' ' . $attributes;
+ }
+ $name = '' if (!defined($name) or ($name !~ /\S/));
+ $href = '' if (!defined($href) or ($href !~ /\S/));
+ $text = '' if (!defined($text));
+ return $text if (($name eq '') and ($href eq ''));
+ $name = "name=\"$name\"" if ($name ne '');
+ $href = "href=\"$href\"" if ($href ne '');
+ $href = ' ' . $href if (($name ne '') and ($href ne ''));
+ return "<a ${name}${href}${attributes}>$text</a>";
+}
+
+