Edgewall Software

Ticket #117 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

$$-escaping eats parts of the content

Reported by: carl Owned by: cmlenz
Priority: major Milestone: 0.4.2
Component: Template processing Version: 0.4
Keywords: Cc:

Description

I'm using the following template:

<div xmlns:py="http://genshi.edgewall.org/"
     py:with="hello='World'">
<div >
  one $hello two $$hello three $$$hello four $$$$hello
 </div>
 <div >
  one $ hello two $${ $$hello $hello } three $$$hello four $$$$ hello
 </div>
</div>

This is what I get from genshi 0.4:

<div>
<div>
  one World$World$hello
 </div>
 <div>
  one $$hello World$World$ hello
 </div>
</div>

This is what I'd like to get:

<div>
<div>
  one World two $hello three $World four $$hello
 </div>
 <div>
  one $ hello two ${ $hello World } three $World four $$$$ hello
 </div>
</div>

or in words: Don't do anything with dollar signs that's not followed by [a-zA-Z_{]. If the number of $-signs (n) is odd, reduce the number of $-signs to (n-1)/2 and do an expression substitution, if it's even just reduce the number of $-signs to n/2.

Attachments

interpolation.diff Download (308 bytes) - added by anonymous 5 years ago.

Change History

Changed 5 years ago by anonymous

Changed 5 years ago by carl

I think I found the problem, and I have attached a patch. This will not be exactly what I wanted above, but I think I can live with it as it is now.

Changed 5 years ago by cmlenz

  • status changed from new to assigned
  • component changed from General to Template processing
  • milestone changed from 0.5 to 0.4.3

Changed 5 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone changed from 0.4.3 to 0.4.2

Doh, this has actually already been fixed in [630] :-P

Add/Change #117 ($$-escaping eats parts of the content)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.