From 15a037150e0d2209d33ac904fc5e0e5f2a884833 Mon Sep 17 00:00:00 2001 From: tateisu Date: Sun, 4 Dec 2022 10:29:55 +0900 Subject: [PATCH] update full_description.pl, just add comments. --- .../android/en-US/full_description.pl | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/fastlane/metadata/android/en-US/full_description.pl b/fastlane/metadata/android/en-US/full_description.pl index 319b9a41..52ffe218 100644 --- a/fastlane/metadata/android/en-US/full_description.pl +++ b/fastlane/metadata/android/en-US/full_description.pl @@ -4,21 +4,23 @@ use warnings; use utf8; use feature qw(say); -my $file = $0; -$file =~ s/\.pl$/\.txt/; - -local $/=undef; +# read from __DATA__ section in this file. +local $/ = undef; my $text = ; -# change multiple spaces and line feeds to single space -# it required for F-droid android client. -$text =~ s/[\x00-\x20]+/ /g; +############################################ +# change spaces and line feeds to single space, +# it's required for F-droid android client. +# also remove head/tail spaces in whole text. -# remove head/tail space +$text =~ s/[\x00-\x20]+/ /g; $text =~ s/\A //; $text =~ s/ \z//; -# HTML block elements and "br". +############################################ +# trim spaces before/after open/close block tags. also
,
,
+ +# HTML block elements and "br". joined with '|' my $blockElements = join "|", qw( address article aside blockquote canvas dd div dl dt fieldset figcaption figure footer form @@ -27,19 +29,23 @@ my $blockElements = join "|", qw( br ); -# block tag it may have attributes, and spaces before/after tag. -my $trimElementsRe = qr!\s*(/"]+|"[^"]*")*/?>)\s*!i; +# RegEx for block tag that may have attributes, and spaces before/after tag. +my $trimElementRe = qr!\s*(/"]+|"[^"]*")*/?>)\s*!i; ## verbose debugging. #say $trimElementsRe; -#while( $text =~ /$trimElementsRe/g){ +#while( $text =~ /$trimElementRe/g){ # next if $& eq $1; # say "[$&] => [$1]"; #} -# trim spaces before/after block tags. also
,
,
-$text =~ s/$trimElementsRe/$1/g; +$text =~ s/$trimElementRe/$1/g; +############################################ + +# write to .txt file. $0 means path of the this script file. +my $file = $0; +$file =~ s/\.pl$/\.txt/ or die "can't make output filename. $0"; open(my $fh,">:utf8",$file) or die "$file $!"; say $fh $text; close($fh) or die "$file $!";