00361: many anchors in one page lead to problems with (:include
Description: It seems to me, that either the (:include:) directive or the recognition of #anchorname has a bug. If I try to include parts of (long) WikiPages via some (:include PageName#from#to:) directives it happens that the #from anchor seems to be unrecognized. My pages look like this:
- PageA: [[#Story1]] blabla [[#Story1_end]] [[#Story2]] blabla [[#Story2_end]] ... [[#StoryX]] blabla [[#StoryX_end]]
- PageB: (:include PageA#Story1#Story1_end:) (:include PageA#Story3#Story3_end:) ... (:include PageA#StoryX#StoryX_end:)
In my case the reference to [[#Story10]] fails. Interestingly [[#Story10_end]] seems to be recognized. So the reference (:include PageA#Story10#Story10_end:) includes PageA from the first line to the line including [[#Story10_end]]. I hope I haven't overlooked 'yet another configuration variable' ;) I have $MaxIncludes=1000; in my config.php.
I tried it on pmwiki.org at Test.IncludeBugB and it seems to work fine. Is there a url I could see the problem with?
I've copied the relevant Pages to [(approve links) edit diff]
Another -- maybe better -- example is [(approve links) edit diff] The problem seems to be the reference to anchors further down a longer page (in this case 0405JanFebBerichte).
I'm sorry, but the pages are in German only. Of course, you can change those Pages, the Group PmTest ist for testing purpose only. If it is helpful, I could try to strip the contents down to the nessecary things or I could try to comment the Markup. Shall I?
I did some further testing with my second example (forget the first one) [(approve links) edit diff] (page 1 in the following). The second relevant page is [(approve links) edit diff] (page 2)
The first page includes two parts of the second one (which consists of chronologically sorted stories about chess events). The second include fails. I suspected that it happens with references to parts of page 2, which are near the bottom of that page. In other words: the problem seems to occur when referring to anchors in long pages.
To test my suspicion I repeatedly deleted some text from page 2. In fact there was a point, where the behaviour changed: If you try to delete the first line of (the markup of) page 2, the references in page 1 work. Even if you insert a simple line break in page 2 after the first four words, everything works perfect.
So I guess the problem has something to do with the number of lines, the number of characters or with the length of single paragraphs above an anchor. But I have no idea, why this happens at all. Is there any restriction for the length of a page?
Interestingly the 'closing anchor' (#to in (:include Page#from#to:)) is not affected -- at least not in my example.
I've tested the above two pages on another system -- they worked fine. I've just set
$EnableDiag=1; on [(approve links)
diff] Maybe, that info helps.