else if ( match(title, /^'.*'$/) ) { sub(/^'/, "", title); sub(/'$/, "", title); }
else if ( match(title, /^\(.*\)$/) ) { sub(/^\(/, "", title); sub(/\)$/, "", title); }
- gsub(/\\/, "", href); gsub(/\\/, "", title); gsub(/[\n\t]+/, " ", title);
+ gsub(/^[\t ]+$/, "", text); gsub(/\\/, "", href);
+ gsub(/\\/, "", title); gsub(/[\n\t]+/, " ", title);
- return "<img src=\"" URL(href, 1) "\" alt=\"" HTML(text) "\"" \
+ return "<img src=\"" URL(href, 1) "\" alt=\"" HTML(text?text:title?title:href) "\"" \
(title?" title=\"" HTML(title) "\"":"") (attrib?" class=\"" HTML(attrib) "\"":"") \
">" inline( substr( line, len + 1) );
else if ( match(title, /^'.*'$/) ) { sub(/^'/, "", title); sub(/'$/, "", title); }
else if ( match(title, /^\(.*\)$/) ) { sub(/^\(/, "", title); sub(/\)$/, "", title); }
- gsub(/\\/, "", href);
+ gsub(/^[\t ]+$/, "", text); gsub(/\\/, "", href);
return "<figure data-src=\"" URL(href, 1) "\"" (attrib?" class=\"" HTML(attrib) "\"":"") ">" \
- "<img src=\"" URL(href, 1) "\" alt=\"" HTML(text) "\"" \
+ "<img src=\"" URL(href, 1) "\" alt=\"" HTML(text?text:title?title:href) "\"" \
(attrib?" class=\"" HTML(attrib) "\"":"") ">" \
(title?"<figcaption>" inline(title) "</figcaption>":"") \
"</figure>\n\n" \