From 187b4e2b6c0ee1601c4ea1bc2b10b933dc22cba1 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Sat, 9 May 2015 20:07:28 +1000 Subject: [PATCH] = Text::Dokuwiki::Render->img --- lib/Text/Dokuwiki/Render/Markdown.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Text/Dokuwiki/Render/Markdown.pm b/lib/Text/Dokuwiki/Render/Markdown.pm index 9b476bc..3c9df9f 100644 --- a/lib/Text/Dokuwiki/Render/Markdown.pm +++ b/lib/Text/Dokuwiki/Render/Markdown.pm @@ -67,9 +67,10 @@ sub p { sub img { my ($self, $attrs, $content) = @_; - my $title = ($attrs->{title}) ? qq( $attrs->{title}) : ""; + my $title = ($attrs->{title}) ? qq( "$attrs->{title}") : ""; + my $alt = $attrs->{alt} || $attrs->{title} || ''; - return sprintf("![%s](%s%s)", $attrs->{alt} // '', $attrs->{src}, $title); + return sprintf("![%s](%s%s)", $alt, $attrs->{src}, $title); } 1;