forked from github/kensanata.oddmuse
* First version. Add a markup so you can have comments in wiki source.
For more info: see http://www.oddmuse.org/cgi-bin/oddmuse/HtmlComment
This commit is contained in:
31
modules/htmlcomment.pl
Normal file
31
modules/htmlcomment.pl
Normal file
@@ -0,0 +1,31 @@
|
||||
# Copyright (C) 2008 Weakish Jiang <weakish@gmail.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# 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
|
||||
#
|
||||
# For user doc, see:
|
||||
# http://www.oddmuse.org/cgi-bin/oddmuse/HtmlComment
|
||||
|
||||
$ModulesDescription .= '<p>$Id: htmlcomment.pl,v 1.1 2008/02/21 17:19:56 weakish Exp $</p>';
|
||||
|
||||
push(@MyRules, \&HtmlCommentRules);
|
||||
|
||||
sub HtmlCommentRules {
|
||||
# /*
|
||||
# This is a comment.
|
||||
# */
|
||||
# This RegExp is borrowed from creole.pl shamelessly.
|
||||
if ($bol && m/\G\/\*[ \t]*\n(.*?\n)\*\/[ \t]*(\n|\z)/cgs) {
|
||||
my $str = $1;
|
||||
$str =~ s/\n \*\//\n\*\//g;
|
||||
return CloseHtmlEnvironments() . '<!--' . $str . '-->'
|
||||
. AddHtmlEnvironment('p');
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user