[ZCM] [ZC] 1854/ 1 Request "Structured Text: single quote in image alt text"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Mon Aug 1 07:11:58 EDT 2005


Issue #1854 Update (Request) "Structured Text: single quote in image alt text"
 Status Pending, Zope/bug+solution medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1854

==============================================================
= Request - Entry #1 by nerby on Aug 1, 2005 7:11 am

Using structured text, it is not possible to have a single quote in the image description string; i.e.

"This isn't working":img:not_working.png

is interpreted as a link with unknown protocol ('img').


Solution

There are two regexp that are used to parse the image syntax, in fileZope\lib\python\StructuredText\DocumentWithImages.py, at lines 33 & 34:

        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

We need to add the single quote to the regexp in the first part:

        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

==============================================================



More information about the Zope-Collector-Monitor mailing list