WeBWorK Problems

How add _blank as html link attribute?

Re: How add _blank as html link attribute?

by Michael Gage -
Number of replies: 0
It is not documented, unfortunately, but you can do what you want. The macro allows an extra variable:
htmlLink($url, $text, $option)

which becomes
<a href="$url" $option >$text</a>

You can put any string you want in $option including
target="_blank".

Since there is no error checking you can get complete HTML garbage if you put the wrong thing in the last slot, which is probably why it wasn't documented. It deserves to be rewritten with more safe features. :-)

-- Mike