2008-06-24 15:42:22 +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-06-24 15:42:22 +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-06-24 15:42:22 +00:00
|
|
|
# http://www.oddmuse.org/cgi-bin/oddmuse/Email_Quote_Extension
|
|
|
|
|
|
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('emailquote.pl', 'Email Quote Extension');
|
2008-06-24 15:42:22 +00:00
|
|
|
|
2015-04-10 13:31:28 +03:00
|
|
|
our ($q, $bol, @MyRules);
|
2015-03-27 03:01:01 +02:00
|
|
|
|
2008-06-24 15:42:22 +00:00
|
|
|
push(@MyRules, \&EmailQuoteRule);
|
|
|
|
|
|
2015-03-27 03:01:01 +02:00
|
|
|
sub EmailQuoteRule {
|
2008-06-26 09:11:30 +00:00
|
|
|
# > on a line of its own should work
|
2015-08-23 21:22:12 +03:00
|
|
|
if ($bol && m/\G(\s*\n)*((\>))+\n/cg) {
|
2008-06-26 08:40:40 +00:00
|
|
|
return $q->p();
|
|
|
|
|
}
|
|
|
|
|
# > hi, you mentioned that:
|
|
|
|
|
# >> I don't like Oddmuse.
|
|
|
|
|
# > in last letter.
|
2015-08-23 21:22:12 +03:00
|
|
|
elsif ($bol && m/\G(\s*\n)*((\>)+)[ \t]/cg
|
|
|
|
|
or InElement('dd') && m/\G(\s*\n)+((\>)+)[ \t]/cg) {
|
2015-03-27 03:01:01 +02:00
|
|
|
my $leng = length($2) / 4;
|
2008-06-26 08:40:40 +00:00
|
|
|
return CloseHtmlEnvironmentUntil('dd') . OpenHtmlEnvironment('dl',$leng, 'quote')
|
|
|
|
|
. $q->dt() . AddHtmlEnvironment('dd');
|
|
|
|
|
}
|
2015-02-27 12:10:18 +02:00
|
|
|
return;
|
2015-03-27 03:01:01 +02:00
|
|
|
}
|