[dokuwiki] Re: Re-generating of meta information for pages

  • From: Christopher Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Tue, 24 Feb 2009 10:40:51 +0900


On 24 Feb 2009, at 08:14, Dmitry Katsubo wrote:

Hi Chris!

I've just realized that you are the author of this plugin! Well, it
works fine for me (except some surprises) and I am thankful for you for
that.

So, in function render() what I need is to add the code:

if($mode == 'meta') {
 if (!$this->meta['title']) $this->meta['title'] = $text;
}


No, its much more complex than that. The plugin doesn't separate header determination from output format. That is, there is no concept of "$text". In "xhtml" format it doesn't know the header text until it processes its own header_close instruction and the plugin only knows the header text in xhtml mode.


I am not sure what to do with this:

if ($this->capture && ($level > 1)) $this->doc .= DOKU_LF. $text.DOKU_LF;

Just ignore?

Is that line in my code? - I can't see it.



Can you give an example, when some syntax modes are not using 'cdata'
instructions, so they break header plugin?

links, many plugins.

'cdata' isn't currently used by the plugin. header_close looks at the generated xhtml and tries to strip tags to leave the content. This will only work for xhtml. Its not feasible to implement a strip for every format, ie. the sensible thing is for the content to be separated into cdata instructions at the handler level. Unfortunately that has never been documented as good practice (which is only my opinion and may not actually be the case).

- Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: