[Zope-dev] Rendering DTML Document / Folder properties as structured-text

Tres Seaver tseaver@palladion.com
Sun, 14 Mar 1999 01:18:08 -0600


Sorry to follow up my own post, but I think I understand the issue now.  Since I
saw at least one other person puzzled by this problem, I thought I'd try to
explain (and let people shoot me down, if I am "even-less-than-an-egg"). 
 
> I am trying to capture "free form" input as a property of a Folder / DTML
> Document, and display it using StructuredText.
> 
> For instance, I define a property, notes, with type text. I then attempt to
> display it, using this DTML:
> 
> <!--var notes fmt="structured-text"-->
> 
> I then enter values into the TEXTAREA for the property, e.g.::
> * foo
> * bar
> 
> When I display the document, I get mixed results: sometimes it will be partly
> rendered as HTML, while sometimes I get the infamous "read only buffer, class"
> error.
> 
> What am I doing wrong?

The __doc__ comment in StructuredText.py specifies:

  - A paragraph that begins with a '-', '*', or 'o' is treated as an
    unordered list (bullet) element.

This requirment prohibits "mashing" the lines together, as I naîvely tried to do
above.  I must leave a blank line between list entries, or else ST cannot
distinguish them.  This has the unfortunate side effect that all lists emitted
by ST look "double spaced", because list items are rendered "around" paragraphs,
e.g:

 <UL>
   <LI> <P> Foo </P>
   <LI> <P> Bar </P>
 </UL>

I will look at what it would take to strip the "enclosed" <P> from list items,
and submit a patch if it looks simple enough (actually, a patch to allow parsing
of list elements without the extra newline would be even better, methinks).

-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com