[Patch] 98_help: fix internal cmd name twice in Telnet & typo in help

Begonnen von Nestor, 13 November 2019, 22:07:35

Vorheriges Thema - Nächstes Thema

Nestor

Telnet is displaying the name for internal commands twice. This is caused by the name also present as an <h3> tag in the commandref and concatenated.

fhem> help attr
Internal command: attrattr
...
fhem> help list
Internal command: listlist
...


--- - 2019-11-13 21:58:49.485206920 +0100
+++ FHEM/98_help.pm 2019-11-13 21:57:11.671359940 +0100
@@ -72,7 +72,8 @@
       $output = $outputInfo.$output;

     } else {
-      $output = "<br/><b>Internal command:</b> $mod";
+      $output = "<br/><b>Internal command:</b> ";
+      $output .= $mod if ( !$cl  or $cl->{TYPE} ne 'telnet' );
    my $i;
    my $f = "$modPath/docs/commandref_frame$lang.html";
       my $skip = 1;
@@ -302,7 +303,7 @@
          <ul>
          <li>valid parameter &lt;language&gt; given</li>
          <li>global attribute language</li>
-         <li>nothing founde: return english</li>
+         <li>nothing found: return english</li>
          </ul>
       </li>
     </ul>

Nestor

Also the regex for replacing <br> with \n is broken.
It doesn't match <br> but only <br?>, maybe you mean <br /> ?

--- - 2019-11-14 09:49:12.000000000 +0100
+++ FHEM/98_help.pm 2019-11-14 09:43:38.000000000 +0100
@@ -92,7 +92,7 @@
}

     if( $cl  && $cl->{TYPE} eq 'telnet' ) { # telnet output     
-    $output =~ s/<br\s*\?>/\n/ig;
+    $output =~ s/<br\s*\/?>/\n/ig;
     $output =~ s/\s*<li>\s*/\n- /ig;
     $output =~ s/<\/?ul>/\n/ig;
     $output =~ s/<\/?[^>]+>//g;