commandref_join.pl: add =end check (Forum #101114)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@19539 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-06-03 20:25:25 +00:00
parent d94878a31a
commit c9fa418c9b
2 changed files with 11 additions and 0 deletions

View File

@ -154,6 +154,7 @@ generateModuleCommandref($$;$$)
my $docCount = 0; my $docCount = 0;
my $hasLink = 0; my $hasLink = 0;
my $dosMode = 0; my $dosMode = 0;
my $nrEnd = 0;
while(my $l = <$modFh>) { while(my $l = <$modFh>) {
$line++; $line++;
@ -163,9 +164,11 @@ generateModuleCommandref($$;$$)
print "*** $lang $mod: nonempty line after =begin html ignored\n" print "*** $lang $mod: nonempty line after =begin html ignored\n"
if($l =~ m/^...*$/); if($l =~ m/^...*$/);
$skip = 0; $line++; $skip = 0; $line++;
$nrEnd++;
} elsif($l =~ m/^=end html$suffix$/) { } elsif($l =~ m/^=end html$suffix$/) {
$skip = 1; $skip = 1;
$nrEnd--;
print $fh "<p>" if($fh); print $fh "<p>" if($fh);
} elsif(!$skip) { } elsif(!$skip) {
@ -222,4 +225,7 @@ EOF
"($tagcount{$tag}, last line ok: $llwct{$tag})\n") "($tagcount{$tag}, last line ok: $llwct{$tag})\n")
if($tagcount{$tag} && !$noWarnings); if($tagcount{$tag} && !$noWarnings);
} }
print "*** $lang $fPath: =end html$suffix: ".($nrEnd>0 ? "missing":"there are too many")."\n"
if($nrEnd);
} }

View File

@ -99,6 +99,7 @@ foreach my $row (split("\n", $fList)) {
my $docCount = 0; my $docCount = 0;
my $hasLink = 0; my $hasLink = 0;
my $hasSummary = 0; my $hasSummary = 0;
my $nrEnd = 0;
while(my $l = <MOD>) { while(my $l = <MOD>) {
$line++; $line++;
@ -117,9 +118,11 @@ foreach my $row (split("\n", $fList)) {
err($fName, "$lang: nonempty line after =begin html.") err($fName, "$lang: nonempty line after =begin html.")
if($l =~ m/^...*$/); if($l =~ m/^...*$/);
$skip = 0; $line++; $skip = 0; $line++;
$nrEnd++;
} elsif($l =~ m/^=end html$suffix$/) { } elsif($l =~ m/^=end html$suffix$/) {
$skip = 1; $skip = 1;
$nrEnd--;
} elsif(!$skip) { } elsif(!$skip) {
$docCount++; $docCount++;
@ -144,6 +147,8 @@ foreach my $row (split("\n", $fList)) {
if(!$suffix && $docCount && !$hasLink); if(!$suffix && $docCount && !$hasLink);
err $fName, "$lang: No summary description found" err $fName, "$lang: No summary description found"
if(!$suffix && $docCount && !$hasSummary); if(!$suffix && $docCount && !$hasSummary);
err $fName, "$lang: =end html$suffix: ".($nrEnd>0 ? "missing":"there are too many")."\n"
if($nrEnd);
foreach $tag (TAGS) { foreach $tag (TAGS) {
err $fName, "$lang: Unbalanced $tag ($tagcount{$tag}, last line ok: $llwct{$tag})" err $fName, "$lang: Unbalanced $tag ($tagcount{$tag}, last line ok: $llwct{$tag})"