summaryrefslogtreecommitdiff
path: root/platform/www/lib/plugins/markdowku/syntax/hr.php
diff options
context:
space:
mode:
Diffstat (limited to 'platform/www/lib/plugins/markdowku/syntax/hr.php')
-rw-r--r--platform/www/lib/plugins/markdowku/syntax/hr.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/platform/www/lib/plugins/markdowku/syntax/hr.php b/platform/www/lib/plugins/markdowku/syntax/hr.php
new file mode 100644
index 0000000..f9da2c0
--- /dev/null
+++ b/platform/www/lib/plugins/markdowku/syntax/hr.php
@@ -0,0 +1,47 @@
+<?php
+/*
+ * Horizontal rulers:
+ * * * *
+ * ---
+ * ___
+ */
+
+if(!defined('DOKU_INC')) die();
+if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
+require_once(DOKU_PLUGIN.'syntax.php');
+
+class syntax_plugin_markdowku_hr extends DokuWiki_Syntax_Plugin {
+
+ function getType() { return 'container'; }
+ function getPType() { return 'block'; }
+ function getSort() { return 8; } /* Before list block parsing. */
+
+ function connectTo($mode) {
+ /* We use two newlines, as we don't want to conflict with setext header
+ * parsing, but also have to be before list blocks. */
+ $this->Lexer->addSpecialPattern(
+ '\n[ ]{0,2}(?:[ ]?\*[ ]?){3,}[ \t]*(?=\n)',
+ $mode,
+ 'plugin_markdowku_hr');
+
+ $this->Lexer->addSpecialPattern(
+ '\n[ ]{0,2}(?:[ ]?-[ ]?){3,}[ \t]*(?=\n)',
+ $mode,
+ 'plugin_markdowku_hr');
+
+ $this->Lexer->addSpecialPattern(
+ '\n[ ]{0,2}(?:[ ]?_[ ]?){3,}[ \t]*(?=\n)',
+ $mode,
+ 'plugin_markdowku_hr');
+ }
+
+ function handle($match, $state, $pos, Doku_Handler $handler) {
+ $handler->_addCall('hr', array(), $pos);
+ return true;
+ }
+
+ function render($mode, Doku_Renderer $renderer, $data) {
+ return true;
+ }
+}
+//Setup VIM: ex: et ts=4 enc=utf-8 :