This post is just a test post, with some code, some Textile torture, and some embedded images so I can test some things. Please feel free to ignore it completely, unless you just want to see how well my blog handles torture.

Here’s some HTML code:


<p>The extra tools &amp; stuff needed to build xnu for Intel have been posted at <a href="http://www.macosforge.org/files/kernel-tools-8J2135.root.tar.gz">/files/kernel-tools-8J2135.root.tar.gz</a>.  These include relpath and seg_hack and will install in /usr/local/bin/.  The <a href="http://kernel.macosforge.org/intel-build-instructions.html">build instructions</a> have also been updated.  Enjoy!
</p>
&lt;div style="color:red;"&gt;This is red text when rendered&lt;/div&gt;
<p>But &lt;span style="color:blue;"&gt;this is blue text when rendered&lt;/span&gt;, not red.</p>

 

And here’s a little PHP code:

  1.  
  2. <?php
  3. /*
  4. Plugin Name: GeshiWrapper
  5. Version: 1.0
  6. Plugin URI: http://www.huddledmasses.org/category/development/wordpress/textile/
  7. Description: Code highlighting using <a href="http://qbnz.com/highlighter/index.php">GeSHI</a> which works with TextileWrapper
  8. Author: Joel Bennett
  9. Author URI: http://www.huddledmasses.org
  10. */
  11.    
  12. require_once( "geshi.php" );
  13.    
  14. function GeshiWrapperPreTextile($text) {
  15.     global $geshiCodes, $geshiUniqueId;
  16.     $geshiUniqueId = uniqid('');
  17.    
  18.     preg_match_all("#<code (?:(?:(?:lang|language)=[\'\"](?P<lang>[a-zA-Z0-9_-]+)[\'\"])|(?:(?:start|line|startline)=[\'\"](?P<line>[0-9]+)[\'\"])|(?:\W+))?[^>]*>(?P<code>.*?)<\/code>#s", $text, $geshiCodes, PREG_SET_ORDER );
  19.     $i = 0;
  20.     foreach ($geshiCodes as $code) {
  21.         $text = str_replace($code[0], $geshiUniqueId.$i++, $text);
  22.     }
  23.     return $text;
  24. }
  25. ?>
  26.  
  27.  

And there is some non-highlighted code. In-line: print( "this is not highlighted" );, and the first part of the Hammurabbi Code in block form:

1. If any one ensnare another, putting a ban upon him, but he can not prove it, then he that ensnared him shall be put to death. 2. If any one bring an accusation against a man, and the accused go to the river and leap into the river, if he sink in the river his accuser shall take possession of his house. But if the river prove that the accused is not guilty, and he escape unhurt, then he who had brought the accusation shall be put to death, while he who leaped into the river shall take possession of the house that had belonged to his accuser.

That’s really a bit silly.

But hey, the whole point here is to just see what works and what doesn’t. Here’s more sample Textile:

This is a green title

This is a less important title

This is some red text. Yeah. Just because I can. Actually, you probably don’t care, but it’s cool that I can highlight text using colors or styles.

This is a block quote. It’s in english. It’s more boring than Dean’s.

We should really have a list or two:

  1. This one is colored blue
  2. Two
  3. Three

We can have multi-level lists:

  1. but unlike markdown
    1. we can’t
    2. have long paragraphs
    3. in our lists
  2. Or can we?
    1. This might look like one. But it probably isn’t, really. What on earth do I mean by that? Well, basically, you can embed HTML code, so as long as you don’t mind doing that, you can put your own paragraph breaks in wherever you like.

      Of course, it looks a lot better if you put them in logical places, and it really screws things up if you forget to close them.

    2. The problem is, you end up putting HTML in, which is ugly.
    3. But have you ever really done that?

We can have mixed lists:

  • Point one
  • Point two
    1. Step 1
    2. Step 2
    3. Step 3
  • Point three
    • Sub point 1
    • Sub point 2

On the topic of inserting plain html, how about we insert an old-fashioned hypertext link? Thankfully, Textile’s clever enough not to muck about with the quote marks in the tags!

This is a link with a title!

this is a header
this is a row
this is another row

A stolen image:

optional alt text

With a link back, so it’s ok ;-) (ooh, look, [announce] [new] my smilies work) [groupwoot][music]. That’s so fun :D [irule] ... [rolleyes] [yawn] someday I’m going to package all of those up into a plugin for distribution [sorry].

Some more text of dubious character. Here is a noisome string of CAPITAL letters. Here is something we want to emphasize.
That was a linebreak. And something to indicate strength. Of course I could still use my own HTML tags if I felt like it.

Coding

This is some code, "isn't it". Check out those quote marks! Now for some preformatted text:


	$text = str_replace("<p>%::%</p>","",$text);
	$text = str_replace("%::%</p>","",$text);
	$text = str_replace("%::%","",$text);

Well, that’s enough of that.