ted serbinski – entrepreneur & web architect
  • thoughts
  • about
  • contact



Popular content

  • I'm a "pilt"
  • Announcing jCalendar - a jQuery date picker
  • Connecting Drupal and Silverlight
  • MothersClick Wins Niche Social Networking Category in Web 2.0 Awards
  • Fedora: Image Manipulation Servlet
  • Best Place to Buy Macbook Pro RAM
  • Drupal on Inside the Net
  • 2 Rainbows over Washington, DC
  • JavaScript Compression
  • Rebuilding a BMW intake: S52 to M50 intake manifold conversion, day 3
more

Recent comments

  • This is a very nice tutorial
    2 days 23 hours ago
  • Yes that would wor
    6 weeks 17 hours ago
  • I’m Thanks
    6 weeks 17 hours ago
  • I’m Thanks
    6 weeks 17 hours ago
  • trial New to your blog.
    7 weeks 3 days ago
more

Getting Textile to work with Digg This button (and other SCRIPT tags)

Textile is my favorite plain text to valid XHTML parser out there. It works beautifully simply, but is also very powerful too. It is much easier to show people how to use this than banging your head over rich text errors and oddness (as a former TinyMCE maintainer, I can validly say, “been there, done that”).

For Drupal, there is a wonderful textile module that the fine folks at Chapter Three LLC have taken over. This module works very simply and in my testing, is much more reliable and bug free in parsing when compared to Markdown with Smarty, which offers very similar parsing capabilities.

However, yesterday when I was working on the announcement for 2 Guys Uncorked, I ran into a problem. How the heck could I get Textile and the Digg This button to work together well?

After some reading, I found this forum post that detailed how to turn textile processing on and off inline. With some fiddling, I found the magic answer to be the following:

  1. notextile.. <div style="float:left; margin-right:1.5em;">
  2. <script>
  3. digg_url = 'http://digg.com/food_drink/2_Guys_Uncorked_launches';
  4. </script>
  5. <script src="http://digg.com/api/diggthis.js"></script>
  6. </div>
  7.  
  8. p. Family & Friends,

The key being to have the notextile.. being on the same line as the code it needed to stop processing and then having the p. on a new line, with a space separating the following content.

And voilà, textile continues to rock :)

posted 22 Jan 2008
  • digg
  • drupal
  • drupal tips
  • textile

No comments

Add your comment

The content of this field is kept private and will not be shown publicly.
  • You can use Textile markup to format text.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <img> <pre>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options


Code examples and downloadable zip files of code are licensed under a Creative Commons License.
All other content, unless where noted, ©2012 Theodore Serbinski. All Rights Reserved.