[ZPT] Is Structured Text Broken in Zope 2.4x ???
Steve Bain
gsbain@hotmail.com
Mon, 15 Oct 2001 17:52:32 -0500
I’m a Zope newbie who is hoping to more-or-less adopt New Religion from the
start.
Structured Text is a very attractive feature of Zope, but I’ve found some
major problems with the Structured Text implementation in Zope 2.4x, and I
suspect that many others must have encountered the same issues.
My current testing is with Zope 2.4.1 on Windows 2000.
I can easily create Structured Text documents (say "stxdoc.stx") in the
members areas of www.zope.org and cmf.zope.org that html-render as
documented and expected.
However those same documents render significantly differently on my local
installation of Zope 2.4.1 when called from a dtml document or dtml method:
<dtml-var stxdoc.stx fmt="structured-text">
Specifically, hierarchical bulleted and numbered lists (i.e. outlines)
render with ugly spacing and tables don't render at all. A possible patch
for the spacing problem appears in a comment by datagrok at the bottom of
this ZWiki page:
http://www.zope.org//Members/jim/StructuredTextWiki/TightParagraphStructuredText
Additional info on the lack of table rendering appears in this post:
http://lists.zope.org/pipermail/zope/2001-September/100485.html
Additional Zope 2.4.x Structured Text issues are documented by Ivan Kurmanov
in this post:
http://lists.zope.org/pipermail/zope/2001-October/100763.html
and by Simon Brunning in this post:
http://lists.zope.org/pipermail/zope/2001-September/100498.html
However, an even much more severe problem lurks in Zope 2.4x. That is that
the structured-text() method in Products.PythonScripts.standard is badly,
badly broken. In addition to the problems listed above, this method doesn’t
html-render links. (i.e. "link name”:http://mydomain.com does *not* cook
into <a href=”http://mydomain.com”>link name</a> , but rather the input text
is copied without any cooking at all!)
The method also sometimes performs incorrect double html_quoting. For
example, structured text that is indented following a paragraph ending in a
double colon (“::”) , is properly cooked into a <pre></pre> tag in the html
output. Unfortunately however, the *content* of the tag is html_quoted
*twice* in the output.
This is quite bad news, because the structured_text method in PythonScripts
is specifically needed for the convenient use of structured text from Zope
Page Templates and restricted Python Scripts:
Rendering structured text from a Zope Page Template:
<span tal:define="global pss modules/Products.PythonScripts.standard">
</span>
<span tal:replace="structure
python:pss.structured_text(getattr(here,'stxdoc.stx'))">
</span>
Rendering structured text from a restricted Script (Python):
# Import the standard method "structured_text()"
from Products.PythonScripts.standard import structured_text
# return a cooked page from a structured text source file
print structured_text(getattr(context, "stxdoc.stx"))
return printed
These bugs appear to be a significant barrier to practical use of Zope Page
Templates.
Am I missing something?
Is the problem simply that StructuredTextNG was used in Zope 2.4x before it
was fully debugged?
Should Zope just revert to ClassicStructuredText (which was at least
stable)?
Steve Bain
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp