2008-02-21 17:19:56 +00:00
|
|
|
# Copyright (C) 2008 Weakish Jiang <weakish@gmail.com>
|
|
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
2015-03-27 03:01:01 +02:00
|
|
|
# it under the terms of the GNU General Public License version 2 as
|
2008-02-21 17:19:56 +00:00
|
|
|
# published by the Free Software Foundation.
|
|
|
|
|
#
|
|
|
|
|
# You can get a copy of GPL version 2 at
|
|
|
|
|
# http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
#
|
2015-03-27 03:01:01 +02:00
|
|
|
# For user doc, see:
|
2008-02-23 15:51:27 +00:00
|
|
|
# http://www.oddmuse.org/cgi-bin/oddmuse/Html_Comment_Extension
|
2008-02-21 17:19:56 +00:00
|
|
|
|
2015-03-27 03:01:01 +02:00
|
|
|
use strict;
|
2015-08-18 10:48:03 +02:00
|
|
|
use v5.10;
|
2015-03-27 03:01:01 +02:00
|
|
|
|
2014-08-21 22:23:23 +02:00
|
|
|
AddModuleDescription('htmlcomment.pl', 'Html Comment Extension');
|
2008-02-21 17:19:56 +00:00
|
|
|
|
2015-04-10 13:31:28 +03:00
|
|
|
our ($bol, @MyRules);
|
2015-03-27 03:01:01 +02:00
|
|
|
|
2008-02-21 17:19:56 +00:00
|
|
|
push(@MyRules, \&HtmlCommentRules);
|
|
|
|
|
|
|
|
|
|
sub HtmlCommentRules {
|
2015-03-27 03:01:01 +02:00
|
|
|
# /*
|
2008-02-21 17:19:56 +00:00
|
|
|
# This is a comment.
|
|
|
|
|
# */
|
2015-03-27 03:01:01 +02:00
|
|
|
# This RegExp is borrowed from creole.pl shamelessly.
|
2008-02-21 17:19:56 +00:00
|
|
|
if ($bol && m/\G\/\*[ \t]*\n(.*?\n)\*\/[ \t]*(\n|\z)/cgs) {
|
|
|
|
|
my $str = $1;
|
|
|
|
|
$str =~ s/\n \*\//\n\*\//g;
|
2015-03-27 03:01:01 +02:00
|
|
|
return CloseHtmlEnvironments() . '<!--' . $str . '-->'
|
2008-02-21 17:19:56 +00:00
|
|
|
. AddHtmlEnvironment('p');
|
|
|
|
|
}
|
2015-02-27 12:10:18 +02:00
|
|
|
return;
|
2015-03-27 03:01:01 +02:00
|
|
|
}
|