rendering HTML with embedded $'s

11 views
Skip to first unread message

alecf

unread,
Jun 18, 2007, 1:52:06 PM6/18/07
to Genshi
So I have some HTML that has (yay) perl sample code in it... i.e.

<pre>
my $x = 4;
</pre>

Problem is, that I can't get this to just render normally. We've tried
$$, CDATA, and more.. the only workaround we've found so far is ${"$"}
but this seems pretty terrible, and ugly as hell.

What's especially odd is that
<pre>
my $$x = 4;
</pre>

renders as
<pre>
$x = 4
</pre>

(note the lack of ' my ' - the beginning of the line is getting
yanked)

Alec

Christopher Lenz

unread,
Jun 18, 2007, 4:54:00 PM6/18/07
to gen...@googlegroups.com
Am 18.06.2007 um 19:52 schrieb alecf:
> So I have some HTML that has (yay) perl sample code in it... i.e.
>
> <pre>
> my $x = 4;
> </pre>
>
> Problem is, that I can't get this to just render normally. We've tried
> $$, CDATA, and more.. the only workaround we've found so far is ${"$"}
> but this seems pretty terrible, and ugly as hell.
>
> What's especially odd is that
> <pre>
> my $$x = 4;
> </pre>
>
> renders as
> <pre>
> $x = 4
> </pre>

Whoa! I'm able to reproduce this, and looking into it. Thanks for
reporting the issue!

Cheers,
Chris
--
Christopher Lenz
cmlenz at gmx.de
http://www.cmlenz.net/

Christopher Lenz

unread,
Jun 18, 2007, 5:02:47 PM6/18/07
to gen...@googlegroups.com
Am 18.06.2007 um 22:54 schrieb Christopher Lenz:
> Am 18.06.2007 um 19:52 schrieb alecf:
>> So I have some HTML that has (yay) perl sample code in it... i.e.
>>
>> <pre>
>> my $x = 4;
>> </pre>
>>
>> Problem is, that I can't get this to just render normally. We've
>> tried
>> $$, CDATA, and more.. the only workaround we've found so far is $
>> {"$"}
>> but this seems pretty terrible, and ugly as hell.
>>
>> What's especially odd is that
>> <pre>
>> my $$x = 4;
>> </pre>
>>
>> renders as
>> <pre>
>> $x = 4
>> </pre>
>
> Whoa! I'm able to reproduce this, and looking into it. Thanks for
> reporting the issue!

Okay, this should be fixed now in trunk and the 0.4.x branch. I'd
appreciate if you could verify the fix. Thanks!

Oh, and the double-dollar escaping is the way to go here. If it
wasn't broken in this case, at least :-P

Carl

unread,
Jun 20, 2007, 5:32:04 PM6/20/07
to Genshi

On Jun 18, 11:02 pm, Christopher Lenz <cml...@gmx.de> wrote:

> Okay, this should be fixed now in trunk and the 0.4.x branch. I'd
> appreciate if you could verify the fix. Thanks!
>

I think you can close ticket 117 now. I submitted a patch that fixed
my problems with this issue
that you can take a look at (a missing yield).

Carl

Reply all
Reply to author
Forward
0 new messages