Subject: | Two Little Bugs in HTML::FormatMarkdown |
Date: | Thu, 4 Feb 2016 13:23:19 -0600 |
To: | bug-HTML-Formatter [...] rt.cpan.org |
From: | William Lindley <wlindley [...] wlindley.com> |
Hello, two bugs to report:
1. In version 2.14 of HTML::FormatMarkdown, the following fails:
HTML::FormatMarkdown->format_string('<a href="foo">foo</a>')
returns only:
[
instead of the expected tag. This is because no text has been
emitted yet; thus, subroutine "out" returns 0 (line 261):
|||$self||->{||'out'||}++;|
because $self->{'out'} is zero; thus a_start (which successfully
emitted the '[' to open the Markdown anchor) returns failure, and
rest of the anchor tag is discarded.
To correct this, probably modify the out subroutine to end with:
|||else| |{|
|||$self||->out(||"["||);
1;
|
|||}|
2. If no alt tag is specified in an <img>, for example
HTML::FormatMarkdown->format_string('<img src="foo.jpg">foo')
a warning is issued:
Use of uninitialized value $alt in concatenation (.) or string at [...] /HTML/FormatMarkdown.pm line 99
the resulting output ( ![][foo.jpg]foo ) is correct, but the warning
is unsightly and should be avoided.
Thank you for considering this report,
\\/
William Lindley
Glenview, IL
480-947-6100