dbrattli
2011-09-10 08:08:55 UTC
Hi,
I tried to add some AddThis (http://www.addthis.com) code to my
webpage and got into problems with Genshi. When trying to render the
following HTML code:
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></
a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/
addthis_widget.js#pubid=ra-4e6b0c632bea7f8f"></script>
<!-- AddThis Button END -->
I get the error:
TemplateSyntaxError: not well-formed (invalid token): line 179, column
52 (/view.html, line 179). The line of problem is the:
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
Looks like Genshi does not like attributes such as g:plusone:size. I
don't know if the code is valid xhtml. I tried adding namespaces such
as g, g:plusone or g:plusone:size without any luck. Almost gave up but
then I managed to get things working with a little pyattrs trick that
I want to share it in case others run into the same problem:
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone"
py:attrs="{'g:plusone:size' : 'medium'}"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/
addthis_widget.js#pubid=ra-4e6b0c632bea7f8f"></script>
<!-- AddThis Button END -->
I tried to add some AddThis (http://www.addthis.com) code to my
webpage and got into problems with Genshi. When trying to render the
following HTML code:
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></
a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/
addthis_widget.js#pubid=ra-4e6b0c632bea7f8f"></script>
<!-- AddThis Button END -->
I get the error:
TemplateSyntaxError: not well-formed (invalid token): line 179, column
52 (/view.html, line 179). The line of problem is the:
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
Looks like Genshi does not like attributes such as g:plusone:size. I
don't know if the code is valid xhtml. I tried adding namespaces such
as g, g:plusone or g:plusone:size without any luck. Almost gave up but
then I managed to get things working with a little pyattrs trick that
I want to share it in case others run into the same problem:
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone"
py:attrs="{'g:plusone:size' : 'medium'}"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/
addthis_widget.js#pubid=ra-4e6b0c632bea7f8f"></script>
<!-- AddThis Button END -->
--
You received this message because you are subscribed to the Google Groups "Genshi" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to genshi+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/genshi?hl=en.
You received this message because you are subscribed to the Google Groups "Genshi" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to genshi+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/genshi?hl=en.