The syntax ![alt](url "title" attr=val attr2=val2) is now valid
\5 # matching quote
[ \t]*
)? # title is optional
+ # MultiMarkdown addition for attribute support
+ ( # Attributes = $7
+ (?<=\s) # lookbehind for whitespace
+ (([ \t]*\n)?[ \t]*((\S+=\S+)|(\S+=".*?")))*
+ )?
\)
)
}{
my $alt_text = $2;
my $url = $3;
my $title = (defined $6) ? $6 : '';
+ my $attrs = $7;
$alt_text =~ s/"/"/g;
$title =~ s/"/"/g;
$title =~ s! _ !$g_escape_table{'_'}!gx;
$result .= " title=\"$title\"";
}
+ if (defined $attrs) {
+ $result .= " $attrs";
+ }
$result .= $g_empty_element_suffix;
$result;