From 29f98f2f2091cb8c1931bb0ac3250b4acac2cc61 Mon Sep 17 00:00:00 2001 From: Weakish Jiang Date: Thu, 21 Feb 2008 17:19:56 +0000 Subject: [PATCH] * 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 --- modules/htmlcomment.pl | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 modules/htmlcomment.pl diff --git a/modules/htmlcomment.pl b/modules/htmlcomment.pl new file mode 100644 index 00000000..5562c712 --- /dev/null +++ b/modules/htmlcomment.pl @@ -0,0 +1,31 @@ +# Copyright (C) 2008 Weakish Jiang +# +# 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 .= '

$Id: htmlcomment.pl,v 1.1 2008/02/21 17:19:56 weakish Exp $

'; + +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() . '' + . AddHtmlEnvironment('p'); + } + return undef; +} + +