commandref_join.pl: more strict tag checking (Forum #105376)

git-svn-id: https://svn.fhem.de/fhem/trunk@20552 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2019-11-20 19:10:13 +00:00
parent 7f4c630101
commit 2aa065f85b

View File

@@ -178,7 +178,12 @@ generateModuleCommandref($$;$$)
$docCount++; $docCount++;
$hasLink = ($l =~ m/<a name="$mod"/) if(!$hasLink); $hasLink = ($l =~ m/<a name="$mod"/) if(!$hasLink);
foreach $tag (TAGS) { foreach $tag (TAGS) {
$tagcount{$tag} +=()= ($l =~ /<$tag>/gi); if($l =~ m/<$tag ([^>]+)>/i) {
my $attr = $1;
print "*** $lang $mod line $line: $tag with attributes (apart ".
"from class) is not allowed\n" if($attr !~ m/class="[^"]*"/);
}
$tagcount{$tag} +=()= ($l =~ /<$tag( [^>]+)?>/gi);
$tagcount{$tag} -=()= ($l =~ /<\/$tag>/gi); $tagcount{$tag} -=()= ($l =~ /<\/$tag>/gi);
if($tagcount{$tag} < 0) { if($tagcount{$tag} < 0) {
print "*** $lang $fPath: negative tagcount for $tag, line $line\n" print "*** $lang $fPath: negative tagcount for $tag, line $line\n"