format fixes

This commit is contained in:
Alexander 2023-02-20 00:35:23 +00:00
parent 978a4d17cf
commit a4b6688433
1 changed files with 5 additions and 3 deletions

View File

@ -39,13 +39,13 @@ for(my $i=1;$i<=$count;$i++) {
# hashtags are converted to links
# <a href="https://mastodon.social/tags/framagit" class="mention hashtag" rel="tag">#<span>framagit</span></a>
$text=~s@<a href=\"[^\"]+\" class=\"mention hashtag\" rel=\"tag\">#<span>(.*)</span></a>@#$1@g;
$text=~s@<a href=\"[^\"]+\" class=\"mention hashtag\" rel=\"tag\">#<span>(.*)</span></a>@ #$1@g;
if ($text=~m@(<a .*</a>)@) {
my $a_tag=$1;
if($a_tag =~ m@href=\"([^\"]+)\"@) {
my $url=$1;
substr($text, index($text, $a_tag), length($a_tag))="\n => $url\n";
substr($text, index($text, $a_tag), length($a_tag))="\n=> $url\n";
}
}
@ -58,8 +58,10 @@ for(my $i=1;$i<=$count;$i++) {
$media =~ s@.*/@@;
$media="=> $media\n";
}
$post{$filedate} || ($post{$filedate}="# $filedate\n");
$post{$filedate}.="# $date
$post{$filedate}.="## $date
$text
$media
";