[pmwiki-users] Strange behavior of include directive -- was: PITS/00361

Christian Bartolomaeus bartolin at gmx.de
Wed Feb 15 10:17:38 CST 2006


Hi,

nearly one year ago I opened a PITS entry (#361) regarding the include
directive. A short description of the problem would be (for a longer
version see below):

<short_story>
Assume the following scenario: Page2 consists of a number of stories.
Each Story is marked with [[#story_1]] at its start and
[[#story_1_end]] at its end. Page1 includes some of the stories from
Page2 via the include directive, using

  (:include Page2#story_1#story_1_end :)
  (:include Page2#story_3#story_3_end :)

There seemed to be a problem, if Page2 became quite long. From a
certain point, some closing #anchors weren't recognized by the include
directive. The result was, that in Page1 not only the specified
stories up to the closing anchors #story_x_end were included, but the
rest of Page2 as well.
</short_story>

As a workaround I began to split my large "story page" (Page2) in
separate shorter pages. I didn't investigate much further in the
problem and PITS/361 was closed in September 2005.

Today I took some time to see, whether the problem was really solved.
It turned out, it wasn't. I moved two sample pages to pmwiki.org and
the problem showed up again. You can see the examples at

  http://www.pmwiki.org/wiki/Test/BugWithInclude1  ## Page1

  http://www.pmwiki.org/wiki/Test/BugWithInclude2  ## Page2

I'm sorry that the text of Page2 is in German but maybe the content of
the page is not too distracting. 

As you can see from the markup, Page1 is supposed to include two
stories from Page2 but it fails to stop at the "closing anchor" of the
first story.

<longer_story>
I use Page2 to show all stories for my chess club in chronological
order. It's a kind of an archive. Each story is marked with an anchor
like [[#story_1]] at its start and with another anchor like
[[#story_1_end]] at its end. 

Other (thematic) pages are used to include specific stories from
Page2. Let's say Page1 is a page which shows all stories about our
blitz chess tournament. Page1 consists of include directives like

  (:include BugWithInclude2#Blitz_Rd_5#Blitz_Rd_5_Ende :)

  (:include BugWithInclude2#Blitz_Rd_4#Blitz_Rd_4_Ende :)

This works pretty well as long as Page2 has a "normal" length. There
is a problem, if Page2 becomes too long. From a certain point,
obviously some closing #anchors aren't recognized by the include
directive. The result is, that in Page1 not only the specified stories
up to the closing anchors (namely the text between #Blitz_Rd_5 and
#Blitz_Rd_5_Ende) is included, but the rest of Page2 as well.

To find the cause of the problem I repeatedly deleted some text from
Page2. In fact there was a point, where the behaviour changed: If you
try to delete the last three sentences of (the markup of) Page2, the
references in Page1 work. Even if you insert a simple line break in
Page2 in front of the 5th word, 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 of
the pages, containing the anchors. 
</longer_story>

I have no idea, why this happens at all. Is there any restriction for
the length of a page? If it's useful to clarify the problem I would be
happy to do some further tests.

By the way, I didn't update the PITS entry 361 -- just sending this
mail to the list.

Greetings

Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /pipermail/pmwiki-users/attachments/20060215/ea387f5e/attachment.bin 


More information about the pmwiki-users mailing list