[Zope-CMF] Image URL - Structured Text problem.

Andreas Jung andreas@andreas-jung.com
Tue, 15 Oct 2002 09:18:34 +0200


What is the sense of this posting since you filed already
a collector issue for this bug?

-aj

--On Dienstag, 15. Oktober 2002 09:09 +0200 Ignacio Dosil Lago 
<idosil@ccietic.usc.es> wrote:

> Structured text fail to recognice image URLs with underscore characters
> "_" The possible cause is that in DocumentWithImages class, when
> compiling regular  expressions, these regular expressions doesn't include
> the "_" underscore  character. By now, it can be hacked by just adding
> the _ character to that  regular expressions but I think there should be
> a way to recognize standad URL characters.
>
> In structured text something like this wouldn't work:
> "Image":img:http://www.somewhere.com/any_image.jpg
>
>
> class DocumentWithImages(DocumentClass):
>     """
>
>     """
>     text_types = ['doc_img',] + DocumentClass.text_types
>
>     def doc_img(self, s,
> expr1=re.compile('\"([_a-zA-Z0-9*.:/;,\-\n\~]+)\":img:([a-zA-Z0-9\-.:/;,\
> n\~]+)').search,
> expr2=re.compile('\"([_a-zA-Z0-9*.:/;,\-\n\~]+)\":img:([a-zA-Z0-9\-.:/;,\
> n\~]+):([a-zA-Z0-9\-.:/;,\n\~]+)').search         ):
>
>  .......
>
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests




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