diff --git a/fhem/contrib/commandref_join.pl b/fhem/contrib/commandref_join.pl index 1a5d17260..d964b9675 100755 --- a/fhem/contrib/commandref_join.pl +++ b/fhem/contrib/commandref_join.pl @@ -74,6 +74,20 @@ printList($) last; } } +my $var; +sub +chkAndGenLangLinks($$$) +{ + my ($l, $lang, $fh) = @_; + $var = $1 if($l =~ m/<\/a>/); + if($l =~ m/(.*?)<\/h3>/ && $var) { + print $fh "\n"; + $var = undef; + } +} foreach my $lang (@lang) { my $suffix = ($lang eq "EN" ? "" : "_$lang"); @@ -100,6 +114,8 @@ foreach my $lang (@lang) { while(my $l = ) { # Header last if($l =~ m/name="perl"/); print OUT $l; + chkAndGenLangLinks($l, $lang, \*OUT); + printList($1) if($l =~ m//); } @@ -110,8 +126,11 @@ foreach my $lang (@lang) { # Copy the tail print OUT '',"\n"; + $var = "perl"; + while(my $l = ) { print OUT $l; + chkAndGenLangLinks($l, $lang, \*OUT); } close(OUT); } @@ -147,15 +166,11 @@ generateModuleCommandref($$;$$) } elsif($l =~ m/^=end html$suffix$/) { $skip = 1; + print $fh "

" if($fh); } elsif(!$skip) { print $fh $l if($fh); - if($l =~ m,

$mod

,i && $fh) { - print $fh "\n"; - } + chkAndGenLangLinks($l, $lang, $fh); $docCount++; $hasLink = ($l =~ m/