diff --git a/action.php b/action.php index 28e488f..fc8455c 100644 --- a/action.php +++ b/action.php @@ -107,8 +107,8 @@ function handle_toolbar(Doku_Event $event, $param) { 'type' => 'format', 'title' => $this->getLang('hi'), 'icon' => '../../plugins/wrap/images/toolbar/hi.png', - 'open' => '<'.$syntaxSpan.' hi>', - 'close' => '', + 'open' => '', + 'close' => '' /* use more semantic markup here! */ ), array( 'type' => 'format', diff --git a/lang/en/lang.php b/lang/en/lang.php index 955f250..8958301 100644 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -15,5 +15,5 @@ $lang['clear'] = 'clear floats'; $lang['em'] = 'especially emphasised'; -$lang['hi'] = 'highlighted'; +$lang['hi'] = 'marked'; $lang['lo'] = 'less significant'; diff --git a/style.less b/style.less index 4f701a7..fd26d9c 100644 --- a/style.less +++ b/style.less @@ -164,11 +164,13 @@ span.wrap_download { background-image: url(images/note/16/download.png); } /* mark ********************************************************************/ -.wrap_hi { +.wrap_hi, +mark { background-color: #ff9; overflow: hidden; } -.wrap__dark.wrap_hi { +.wrap__dark.wrap_hi, +mark.wrap__dark { background-color: #4e4e0d; } diff --git a/syntax/div.php b/syntax/div.php index 47dbe82..9ddd4e3 100644 --- a/syntax/div.php +++ b/syntax/div.php @@ -10,6 +10,7 @@ class syntax_plugin_wrap_div extends DokuWiki_Syntax_Plugin { protected $special_pattern = '\r\n]*?/>'; protected $entry_pattern = '(?=.*?)'; protected $exit_pattern = ''; + protected $output_tag = 'div'; function getType(){ return 'formatting';} function getAllowedTypes() { return array('container', 'formatting', 'substition', 'protected', 'disabled', 'paragraphs'); } @@ -103,12 +104,12 @@ function render($format, Doku_Renderer $renderer, $indata) { $wrap = $this->loadHelper('wrap'); $attr = $wrap->buildAttributes($data, 'plugin_wrap'); - $renderer->doc .= ''; - if ($state == DOKU_LEXER_SPECIAL) $renderer->doc .= ''; + $renderer->doc .= '<'.$this->output_tag.$attr.'>'; + if ($state == DOKU_LEXER_SPECIAL) $renderer->doc .= 'output_tag.'>'; break; case DOKU_LEXER_EXIT: - $renderer->doc .= ''; + $renderer->doc .= 'output_tag.'>'; $renderer->finishSectionEdit(); break; } @@ -118,7 +119,7 @@ function render($format, Doku_Renderer $renderer, $indata) { switch ($state) { case DOKU_LEXER_ENTER: $wrap = plugin_load('helper', 'wrap'); - array_push ($type_stack, $wrap->renderODTElementOpen($renderer, 'div', $data)); + array_push ($type_stack, $wrap->renderODTElementOpen($renderer, $this->output_tag, $data)); break; case DOKU_LEXER_EXIT: diff --git a/syntax/span.php b/syntax/span.php index e624348..e7f2945 100644 --- a/syntax/span.php +++ b/syntax/span.php @@ -10,6 +10,7 @@ class syntax_plugin_wrap_span extends DokuWiki_Syntax_Plugin { protected $special_pattern = '\r\n]*?/>'; protected $entry_pattern = '(?=.*?)'; protected $exit_pattern = ''; + protected $output_tag = 'span'; function getType(){ return 'formatting';} function getAllowedTypes() { return array('formatting', 'substition', 'disabled'); } @@ -70,12 +71,12 @@ function render($format, Doku_Renderer $renderer, $indata) { $wrap = $this->loadHelper('wrap'); $attr = $wrap->buildAttributes($data); - $renderer->doc .= ''; - if ($state == DOKU_LEXER_SPECIAL) $renderer->doc .= ''; + $renderer->doc .= '<'.$this->output_tag.$attr.'>'; + if ($state == DOKU_LEXER_SPECIAL) $renderer->doc .= 'output_tag.'>'; break; case DOKU_LEXER_EXIT: - $renderer->doc .= ''; + $renderer->doc .= 'output_tag.'>'; break; } return true; @@ -84,7 +85,7 @@ function render($format, Doku_Renderer $renderer, $indata) { switch ($state) { case DOKU_LEXER_ENTER: $wrap = plugin_load('helper', 'wrap'); - array_push ($type_stack, $wrap->renderODTElementOpen($renderer, 'span', $data)); + array_push ($type_stack, $wrap->renderODTElementOpen($renderer, $this->output_tag, $data)); break; case DOKU_LEXER_EXIT: diff --git a/syntax/spanmark.php b/syntax/spanmark.php new file mode 100644 index 0000000..3c97724 --- /dev/null +++ b/syntax/spanmark.php @@ -0,0 +1,19 @@ + ... syntax + * + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * @author Anika Henke + * @author Sascha Leib + */ + +class syntax_plugin_wrap_spanmark extends syntax_plugin_wrap_span { + + protected $special_pattern = '\r\n]*?/>'; + protected $entry_pattern = '(?=.*?)'; + protected $exit_pattern = ''; + protected $output_tag = 'mark'; + +} \ No newline at end of file