svn commit: r264567 - user/des/fbp/lib/Template/Plugin

Dag-Erling Smørgrav des at FreeBSD.org
Wed Apr 16 21:47:52 UTC 2014


Author: des
Date: Wed Apr 16 21:47:51 2014
New Revision: 264567
URL: http://svnweb.freebsd.org/changeset/base/264567

Log:
  Set a custom syntax for literal blocks.  The default whitespace magic
  doesn't work well with diffs.

Modified:
  user/des/fbp/lib/Template/Plugin/WikiFormat.pm

Modified: user/des/fbp/lib/Template/Plugin/WikiFormat.pm
==============================================================================
--- user/des/fbp/lib/Template/Plugin/WikiFormat.pm	Wed Apr 16 21:47:11 2014	(r264566)
+++ user/des/fbp/lib/Template/Plugin/WikiFormat.pm	Wed Apr 16 21:47:51 2014	(r264567)
@@ -16,6 +16,20 @@ use Text::WikiFormat;
 
 L<Template::Toolkit> filter plugin for L<Text::WikiFormat>
 
+=cut
+
+our $TAGS = {
+    blocks => {
+	code => qr/^: /,
+    },
+};
+
+our $OPTIONS = {
+    absolute_links => 1,
+    implicit_links => 0,
+    extended => 1,
+};
+
 =head1 METHODS
 
 =head2 init
@@ -43,8 +57,7 @@ sub filter($$) {
     my ($self, $raw) = @_;
 
     print(STDERR "Template::Plugin::WikiFormat::filter()\n");
-    return Text::WikiFormat::format($raw, {}, {
-	implicit_links => 0, extended => 1, absolute_links => 1 });
+    return Text::WikiFormat::format($raw, $TAGS, $OPTIONS);
 }
 
 =head1 AUTHOR


More information about the svn-src-user mailing list