2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

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 c996a2a75c
commit c3eaadaa04

View File

@ -178,7 +178,12 @@ generateModuleCommandref($$;$$)
$docCount++;
$hasLink = ($l =~ m/<a name="$mod"/) if(!$hasLink);
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);
if($tagcount{$tag} < 0) {
print "*** $lang $fPath: negative tagcount for $tag, line $line\n"