[dokuwiki] Re: Fixing p_get_first_heading()

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 15 Sep 2005 12:56:27 +0200

On Tue, 13 Sep 2005 19:25:23 -0500 (CDT)
"Joe Lapp" <joe.lapp@xxxxxxxxx> wrote:

> I just noticed that the RSS feed calls p_wiki_xhtml() on each entry
> anyway, in order to generate the tag-stripped, truncated description. 

And this exactly why the thing is so damn slow. I'd love to get rid of
that.

> An additional call to p_get_first_heading() would wastefully load the
> cached instructions twice (unless the parser does in-memory caching
> across invocations).  And since I have the raw HTML anyway, I might as
> well preg_match() for the first heading and drop the call to
> p_get_first_heading() altogether.
> 
> This solves the RSS feed problem.  That was my primary concern.

For now that's fine.

> Waddayasay?  Should I snag the RSS title from the HTML and add a
> config variable that undoes that one $conf['useheading'] behavior? 
> Does anyone like that link-for-title replacement?  Can we just dump it
> altogether and not bother with yet another config variable?  Just
> checking!

Get the title from XHTML when $conf['useheading'] is enabled for now.
Changing the whole behaviour if we can agree on something is the next
step.

Andi

Other related posts: