[Zope] StructuredText not doing punctuation properly

Andreas Jung Andreas Jung <lists@andreas-jung.com>
Wed, 20 Nov 2002 08:25:53 +0100


--On Mittwoch, 20. November 2002 15:11 +0800 Ramachandran Sreeram 
<gro.mareers@sreeram.org> wrote:

> Hi,
>
> STX doesn't do punctuation properly.
>
> When given text like this: this is a "link":something. that
> STX is supposed to give:   this is a <a href="something">link<a>. that
> But, I get:                this is a <a href="something.">link</a> that
>
> This happens with all punctuation (period, comma, etc.)
>
> Mine is a stock Python 2.1 + Zope 2.6.0 installation (on Debian 3.0
> tracking "testing").
>
> I have checked the sources under lib/python/StructuredText and they seem
> to be using the correct regexes.
>
> I also ran the regression tests and they all passed. In particular, the
> "HTML regression test" passed without any problems.
>
> However, when I render a document on the actual Zope instance, I get the
> above problem.

To be short: STXNG is a mess and fixing bugs on one side raise bugs
on the other side. Feel free to submit a collector issue or even better
a patch that fixes the problem.


>
> Any ideas on how to fix them?
>
> - Is it something to do with the regex libraries (either python libraries
>   or system regex libraries)?

Hell, yes.

>
> - Is it something to do with what classes (or types) of the StructuredText
>   module are being used in a "Document"?
>

The standard DocumentClass.

> - Has anyone else experienced this?
>

> There are a couple of other problems also:
>
> - STX doesn't strip the indentation from code samples. I.e., after a
>   paragraph which ends with "::", I have a code sample. The code sample
> has   to be indented deeper than the preceding paragraph for it to be
> recognized. But, when rendering, the indentation is preserved, causing all
>   the lines of the code to be deeply indented. I thought it was supposed
> to   strip the leading whitespace (atleast upto the minimum indentation).

Maybe a regex problem as well...


>
> - Tables are formed like so:
>      |---|
>      |a|b|


Check out the example file in the regression folder of STXNG.

Sorry, this mail was not very helpful but STXNG is some kind of a nightmare.
As an alternative you should have a look at the integration of 
reStructuredText
into Zope (currently on the ajung-restructuredtext-integration-branch in 
the CVS).
I think about providing some patches to make reST available for Zope 2.6.

-aj

    ---------------------------------------------------------------------
   -    Andreas Jung                     http://www.andreas-jung.com   -
  -   EMail: andreas at andreas-jung.com                              -
   -            "Life is too short to (re)write parsers"               -
    ---------------------------------------------------------------------