Tidy gives warning: "trimming empty <span>" with Fivestar
Balrog - June 23, 2009 - 17:17
| Project: | Fivestar |
| Version: | 6.x-1.15 |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
When I use the line
<?php
print $node->content['fivestar_widget']['#value']
?><?php
print $comment->fivestar_view
?>4.666665
This causes the HTML to not validate because of the empty "Warning: trimming empty ."

#1
Looks like it got dropped ...
<div class="fivestar-widget-static fivestar-widget-static-vote fivestar-widget-static-5 clear-block"><div class="star star-1 star-odd star-first"><span class="on">4</span></div><div class="star star-2 star-even"><span class="on"></span></div><div class="star star-3 star-odd"><span class="on"></span></div><div class="star star-4 star-even"><span class="on"></span></div><div class="star star-5 star-odd star-last"><span class="off"></span></div></div>#2
Empty tags are valid XHTML, that's actually just a message generated by Tidy when it parses the page (assuming that's what you're using to do the validation). If you run the HTML against http://validator.w3.org/, you'll see that it validates just fine. However it would still be nice to get rid of that warning, even if it's only generated by Tidy.
#3
Yes, I was using Tidy. I use the serial validator in the Firefox extension.
#4
you could overwrite the theme function 'theme_fivestar_static' an simply add an else tree to this if condition:
if ($n == 1)$output .= $numeric_rating; (zeile 1417)
there you put an html comment and your warnings are gone
peter
#5
Just noticed this as well, I prefer a clean html also :)
Peter can you put your suggestion in
tags to be clear where to comment out stuff?