Closed zd-dalibor closed 11 years ago
you can override autolink
method like this.
<?php
class Sample extends \Sundown\Render\HTML
{
public function autolink($link, $type)
{
return sprintf('<a href="%s" target="_blank">%s</a>', $link, $link);
}
}
$md = new \Sundown\Markdown(new \Sample, array("autolink"=>true));
echo $md->render("visit http://www.google.com");
# <p>visit <a href="http://www.google.com" target="_blank">http://www.google.com</a></p>
see also https://github.com/chobie/php-sundown/blob/development/docs/Render.md
I will try this.
@chobie Yes, this does the trick. Thanks.
Is there any way to tell autolink extension to generate link with target="_blank"