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

Ignacio Dosil Lago idosil@ccietic.usc.es
Tue, 15 Oct 2002 09:09:47 +0200


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
        ):

 .......