header selector

入手元

ソース修正

そのままではなんか正常に表示されなかったけどデバッグしてみた結果一部修正して解決。

/lib/plugins/headerselector/syntax.php
~略~
	/**
	 * to render the content
	 * replace the contents which were already output
	 * @param $format Format specified in the renderer
	 * @param $renderer reference renderer
	 * @param $data value returned by handler
	 * 
	 * <h3><a name="title" id="title">title</a></h3>
	 * <h3><a name="title1" id="title1">title</a></h3>
	 * Even the same title at the same level, it is unique
	 */
	public function render($format, &$renderer, $data)
	{
		if ($format == 'xhtml' && $data)
		{
			$rows   = explode("\n", $renderer->doc);
			$target = $rows[count($rows) - 5];
			//preg_match('|^(<h[1-6])(>)(.+?)(</h[1-6]>)$|', $target, $matches);
			preg_match('|^(<h[1-6])(.*?>)(.+?)(</h[1-6]>)$|', $target, $matches);
			$renderer->doc = strtr($renderer->doc, array($target => $matches[1].$data.$matches[2].$matches[3].$matches[4]));
			return true;
		}
		return false;
	}
~略~

preg_match()の正規表現を修正。
テンプレがarcticだからなのかな?

2013/4/16
なんかまたダメになってたので再修正。
てか配布元消えちゃってるな。

dokuwiki/plugin/headerselector.txt · 最終更新: 2016/02/15 18:45 by 127.0.0.1
CC Attribution-Noncommercial-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0