Skip to content

Commit

Permalink
Update tagPoetryLgSp.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
jhellingman committed Jan 27, 2025
1 parent f2682ad commit 6804838
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pptools/tagPoetryLgSp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
use strict;
use warnings;

my $initialSpaceCount = 0;
my $initialSpaces = ' ' x $initialSpaceCount;

my $lgSeen = 0;
my $spSeen = 0;
my $spLooksLikeProse = 0;
Expand Down Expand Up @@ -70,16 +73,16 @@
print "</lg>\n\n<lg>\n";
} elsif ($line =~ /^\s*<l>/) { # Already tagged
print $line;
} else {
} else {
# count white space before
$line =~ /^(\s*)(.*)$/;
my $spaces = $1;
$line = $2;
my $n = length($spaces);
if ($n == 0) {
print " <l>$line\n";
print "$initialSpaces<l>$line\n";
} else {
print " $spaces<l rend=\"indent($n)\">$line\n";
print "$initialSpaces$spaces<l rend=\"indent($n)\">$line\n";
}
}
}
Expand Down

0 comments on commit 6804838

Please sign in to comment.