Permalink
Browse files

return original contents for unknown macros

this fixes problem with [editx](http://www.dokuwiki.org/plugin:editx) that it's `@link@` macro present in [lang/en/intro.txt](https://github.com/danny0838/dw-editx/blob/master/lang/en/intro.txt) does not get replaced
  • Loading branch information...
glensc committed Jun 24, 2012
1 parent ad2494d commit f634433719e7fa5632c0bcbc3c937c8e40a01b66
Showing with 7 additions and 6 deletions.
  1. +1 −1 plugin.info.txt
  2. +6 −5 syntax.php
@@ -2,7 +2,7 @@
base var
author Gina Häußge, Michael Klier, Esther Brunner
email dokuwiki@chimeric.de
date 2009-03-25
date 2012-06-24
name Variable Plugin
desc Insert dynamic variables.
url http://www.dokuwiki.org/plugin:var
@@ -5,13 +5,13 @@
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Esther Brunner <wikidesign@gmail.com>
*/
// must be run within Dokuwiki
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_var extends DokuWiki_Syntax_Plugin {
function getType() { return 'substition'; }
@@ -21,7 +21,7 @@ function connectTo($mode) { $this->Lexer->addSpecialPattern('@\w{2,6}@', $mode,
function handle($match, $state, $pos, &$handler) {
$match = substr($match, 1, -1); // strip markup
return array($match);
}
}
function render($mode, &$renderer, $data) {
global $ID;
@@ -81,7 +81,8 @@ function render($mode, &$renderer, $data) {
$nocache = true;
break;
default:
$xhtml = $meta;
// for unknown match render original
$xhtml = "@{$meta}@";
break;
}
@@ -101,4 +102,4 @@ function render($mode, &$renderer, $data) {
return false;
}
}
// vim:ts=4:sw=4:et:enc=utf-8:
// vim:ts=4:sw=4:et:enc=utf-8:

0 comments on commit f634433

Please sign in to comment.