OSDN Git Service

rawプラグインを追加。
authortakezoe <takezoe@871d6764-1e22-0410-b313-a55050885396>
Sun, 9 Oct 2011 17:27:14 +0000 (17:27 +0000)
committertakezoe <takezoe@871d6764-1e22-0410-b313-a55050885396>
Sun, 9 Oct 2011 17:27:14 +0000 (17:27 +0000)
takezoe/plugin/book/Install.pm
takezoe/plugin/book/Raw.pm [new file with mode: 0644]

index fd02863..e9a19c8 100644 (file)
@@ -40,6 +40,7 @@ sub install {
        $wiki->add_hook("title3", "plugin::book::Title3");
        
        $wiki->add_inline_plugin("br", "plugin::book::Br");
+       $wiki->add_inline_plugin("raw" ,"plugin::book::Raw" ,"HTML");
        $wiki->add_paragraph_plugin("keyword" ,"plugin::book::Keyword" ,"HTML");
        
        my @paths = split(/\//, $wiki->get_CGI()->path_info());
diff --git a/takezoe/plugin/book/Raw.pm b/takezoe/plugin/book/Raw.pm
new file mode 100644 (file)
index 0000000..34f9f2a
--- /dev/null
@@ -0,0 +1,30 @@
+################################################################################
+#
+# <p>°ú¿ô¤Ç»ØÄꤷ¤¿Ê¸»úÎó¤ò¤½¤Î¤Þ¤Þɽ¼¨¤¹¤ë¥¤¥ó¥é¥¤¥ó¥×¥é¥°¥¤¥ó¤Ç¤¹¡£</p>
+# <pre>
+# {{raw '''°ú¿ô¤Ç»ØÄꤷ¤¿Ê¸»úÎó¤ò¤½¤Î¤Þ¤Þɽ¼¨¤·¤Þ¤¹'''}}
+# </pre>
+#
+################################################################################
+package plugin::book::Raw;
+use Encode qw(decode);
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥¤¥ó¥é¥¤¥ó¥á¥½¥Ã¥É
+#==============================================================================
+sub inline {
+       my $self = shift;
+       my $wiki = shift;
+       my $text = shift;
+       return Util::escapeHTML($text);
+}
+
+1;