Link underscore fixes.

This commit is contained in:
Chris 2015-08-03 15:00:49 +01:00
parent b1ecc2ac6e
commit f5db8d1a77

View File

@ -884,7 +884,7 @@ sub format_time {
$datestr =~ s/(\d+)\s*%o/ordinal($1)/ge;
# Trim leading zeros, as they are pointless
$datestr =~ s/(\A|\D)0+([1-9])/$1$2/g;
$datestr =~ s/(\A|\b)0+([1-9])/$1$2/g;
return $datestr;
}
@ -1035,6 +1035,9 @@ sub html_to_markdown {
# Sometimes there are bizarre <>s left in the content, dunno why...
$body =~ s|<>||g;
# Fix underscores in links
$body =~ s|\[([^\]+)\]|_fix_link_underscores($1)|g;
$body =~ s|\n\n+|\n\n|g;
my $imglist = "";
@ -1080,6 +1083,14 @@ sub _markdown_underline {
}
sub _fix_link_underscores {
my $text = shift;
$text =~ s/\\_/_/g;
return $text;
}
## @method $ bytes_to_human($bytes, $long)
# Convenience wrappper around humanise_bytes for backwards compatibility.
#