Files
oddmuse/modules/fieldlist.pl
Alex Schroeder f11e2a8731 getting rid of $Id$ tags in $WikiDescription
Replaced the $Id$ tags in $WikiDescription for all the modules and wiki.pl itself with a link to the source and an appropriate wiki page, if possible. This is shown in action=version and should help users figure out what another wiki has installed.
2012-04-19 02:18:45 +02:00

28 lines
1.1 KiB
Perl

# 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/Field_List_Extension
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/fieldlist.pl">fieldlist.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Field_List_Extension">Field List Extension</a></p>';
push(@MyRules, \&FieldListRules);
sub FieldListRules {
# :fieldname: fieldbody
if ($bol && m/\G\s*\:(?=(((\S.*\S)|\S)\:))/cg
or InElement('dd') && m/\G\s*\n(\s)*\:(?=(((\S.*\S)|\S)\:))/cg) {
return CloseHtmlEnvironmentUntil('dd') . OpenHtmlEnvironment('dl', 1, 'fieldlist')
. AddHtmlEnvironment('dt'); # `:' needs special treatment, later
} elsif (InElement('dt') and m/\G\:[ \t]*(?=((\S)+))/cg) {
return CloseHtmlEnvironment() . AddHtmlEnvironment('dd');
}
return undef;
}