[ZCM] [ZC] 56/ 3 Reject "Nested Colouring in Structured Text"
Collector: Zope Bugs, Features, and Patches ...
zope-coders-admin@zope.org
Wed, 05 Mar 2003 09:45:04 -0500
Issue #56 Update (Reject) "Nested Colouring in Structured Text"
Status Rejected, Zope/feature+solution medium
To followup, visit:
http://collector.zope.org/Zope/56
==============================================================
= Reject - Entry #3 by matt on Mar 5, 2003 9:44 am
Status: Accepted => Rejected
OK, this isn't an issue anyone has cared to take up. Closing this after a lot of inactivity.
________________________________________
= Assign - Entry #2 by matt on Nov 30, 2001 2:50 pm
Status: Pending => Accepted
Supporters added: ajung
________________________________________
= Request - Entry #1 by alburt on Nov 27, 2001 10:39 am
Uploaded: "patch"
- http://collector.zope.org/Zope/56/patch/view
Despite comments in the docstrings to
the contrary, structured text does not
allow arbitrary nested colorings. I like
structured text and think this is
definitely not the *right thing*
(TM). This patch will allow nesting.
Let me explain what I did. The old
algorithm was:
For each paragraph, go through the
list 'text_types' one type at a time
and chunk up the text into plain
strings and markup objects.
The problem is that the regexps in
doc_href, doc_emphasize etc. only work
on plain strings not the chunked up mix
of markup and strings. And so, depending
on the ordering of the list
'text_types', sometimes they match (when
they hit plain text) and sometimes they
do not (when they hit the same text in
chunked up form).
My proposed solution:
Separate the regexps from the doc_*
functions; repeatedly search for the
next matching regexp and chun up the
text matched by the regexp into markup
objects whilst applying the algorithm
recursivley to the text within the
markup object.
For nested markup, this forces the outer
markup to match before the inner markup.
As a result we have arbitrary nesting of
colorings but not overlapping - but then
what markup langauge allows that?
==============================================================