[pmwiki-users] Preformatted text problem

Patrick R. Michaud pmichaud at pobox.com
Sat Feb 26 12:05:15 CST 2011


On Sat, Feb 26, 2011 at 07:33:40PM +0200, tkcusr wrote:
> I've pretty much reduced the problem to its roots.
> It happens in preformatted text that follows a definition list. See
> the test case at http://www.pmwiki.org/wiki/Test/Preform
> The line of 4's is broken out of <pre> tag and pmwiki somehow thinks
> it's a definition list. But then continues on preformatting with the
> next line.
> I'd like to read the argument that claims this is not a bug, if any.

I'm not sure I'll call this a bug, and fixing the code may at any rate
be very difficult.  Fixing it in the markup is trivial, however.

PmWiki treats any line that aligns horizontally with the text of a
previous list item as being a continuation of that list item.  This
is very useful for something like:

    # This is the first item
      * This is a bullet list nested in the first item
      * More bullet list
      More text that is still part of the first item
    # This is the second item

Without this "aligned text continues a list item" feature, getting
the "More text ..." to be part of the first item is very difficult.
Also, the above markup is what people naturally expect to work.

So, in the case you've posted, what we have is:

  :definition:definition text

        Preformatted text
        Preformatted text
   continuation of definition
        Preformatted text

I'm not willing to claim that preformatted text should 
automatically halt the definition list.  One might say that
the heading should halt the definition list... but I'm not
even inclined to agree with that.  

The solution to the problem is fairly simple -- use [==] 
to force the end of the definition list:

  :definition:definition text
  [==]
        Preformatted text
        Preformatted text
   Preformatted text
        Preformatted text

See this demonstrated at http://www.pmwiki.org/wiki/Test/Preform2 .

Or, use [@...@] for the preformatted text.

  :definition:definition text
  [@
        Preformatted text
        Preformatted text
   Preformatted text
        Preformatted text
  @]


This is all documented at 
http://www.pmwiki.org/wiki/PmWiki/TextFormattingRules#WhitespaceRules,
and since PmWiki is behaving exactly as documented (and designed)
I'm inclined to leave things pretty much as they are.

Pm



More information about the pmwiki-users mailing list