[ZCM] [ZC] 1854/ 2 Resolve "Structured Text: single quote in image
alt text"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Sun Aug 7 09:14:24 EDT 2005
Issue #1854 Update (Resolve) "Structured Text: single quote in image alt text"
Status Resolved, Zope/bug+solution medium
To followup, visit:
http://www.zope.org/Collectors/Zope/1854
==============================================================
= Resolve - Entry #2 by ajung on Aug 7, 2005 9:14 am
Status: Pending => Resolved
Fixed on SVN trunk r37768 and 2.8 branch r37769.
________________________________________
= 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