Does anyone know how I might get rid of breaks/newlines from the_excerpt? I want to configure a digg badge for each of my posts, and the code looks like this:
<script type="text/javascript">
digg_url = '<?php the_permalink(); ?>';
digg_title = '<?php the_title(); ?>';
digg_bodytext = '<?php the_excerpt(); ?>';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
The only problem, however, is that the_excerpt for some posts returns a string with a new line. Thus, the javascript thinks that there is an error, an unterminated string literal. I tried digg_bodytext = '<?php trim(the_excerpt()); ?>'; but that didn't work.
Any suggestions? (And sorry if this is the wrong section...I wasn't sure if it was a "hack" or something "advanced" - it's not really any of them.)