wiki.pl: Port some fixes from upstream
[Orgmuse.git] / modules / htmlcomment.pl
blob0ef25ce78f0e7c9abf4d9c844ab6d3bc3a8673a6
1 # Copyright (C) 2008 Weakish Jiang <weakish@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License version 2 as
5 # published by the Free Software Foundation.
7 # You can get a copy of GPL version 2 at
8 # http://www.gnu.org/licenses/gpl-2.0.html
10 # For user doc, see:
11 # http://www.oddmuse.org/cgi-bin/oddmuse/Html_Comment_Extension
13 $ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/htmlcomment.pl">htmlcomment.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Html_Comment_Extension">Html Comment Extension</a></p>';
15 push(@MyRules, \&HtmlCommentRules);
17 sub HtmlCommentRules {
18 # /*
19 # This is a comment.
20 # */
21 # This RegExp is borrowed from creole.pl shamelessly.
22 if ($bol && m/\G\/\*[ \t]*\n(.*?\n)\*\/[ \t]*(\n|\z)/cgs) {
23 my $str = $1;
24 $str =~ s/\n \*\//\n\*\//g;
25 return CloseHtmlEnvironments() . '<!--' . $str . '-->'
26 . AddHtmlEnvironment('p');
28 return undef;