OSDN Git Service

自動リンク機能がある程度安定しているようなので、現時点でのブランチorigin/autolinkをmasterにmerge。
[kenranchat/yadchat.git] / yadchatlib.pl
index 65fd3a3..5ff9781 100644 (file)
@@ -462,6 +462,11 @@ sub formatDat {
         $i++;
         if ($lnum ne 'max' && $i > $lnum) { last; }
         local($date,$name,$email,$comment,$color) = split(/<>/, $line);
+        # \8e©\93®\83\8a\83\93\83NON\82È\82ç\82ÎURL\95\8e\9a\97ñ\92u\82«\8a·\82¦$
+        if ( $CONF{'autolink'} ) {
+            # URL Auto Link
+            $comment =~ s/(s?https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/<a href="\1" target="_blank">\1<\/a>/g;
+        }
         $ret .= $query->hr;
         if ($weight eq 'light') {
             $ret .= "$name \81\84 $comment ";
@@ -505,7 +510,7 @@ sub genLogfile {
     print LOG $query->start_html(-lang => $CONF{'lang'},
                  -encoding => $CONF{'charset'},
                  -head => meta({-http_equiv => 'Content-Type',
-                                -content    => 'text/html'}),
+                                -content    => 'text/html; charset=' . $CONF{'charset'}}),
                  -title=>$title,
                  -style=>{-src=>"../$CONF{'chatstyle'}"});