Link underscore fixes.
This commit is contained in:
parent
b1ecc2ac6e
commit
f5db8d1a77
@ -884,7 +884,7 @@ sub format_time {
|
|||||||
$datestr =~ s/(\d+)\s*%o/ordinal($1)/ge;
|
$datestr =~ s/(\d+)\s*%o/ordinal($1)/ge;
|
||||||
|
|
||||||
# Trim leading zeros, as they are pointless
|
# 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;
|
return $datestr;
|
||||||
}
|
}
|
||||||
@ -1035,6 +1035,9 @@ sub html_to_markdown {
|
|||||||
# Sometimes there are bizarre <>s left in the content, dunno why...
|
# Sometimes there are bizarre <>s left in the content, dunno why...
|
||||||
$body =~ s|<>||g;
|
$body =~ s|<>||g;
|
||||||
|
|
||||||
|
# Fix underscores in links
|
||||||
|
$body =~ s|\[([^\]+)\]|_fix_link_underscores($1)|g;
|
||||||
|
|
||||||
$body =~ s|\n\n+|\n\n|g;
|
$body =~ s|\n\n+|\n\n|g;
|
||||||
|
|
||||||
my $imglist = "";
|
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)
|
## @method $ bytes_to_human($bytes, $long)
|
||||||
# Convenience wrappper around humanise_bytes for backwards compatibility.
|
# Convenience wrappper around humanise_bytes for backwards compatibility.
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user