Topic: New extension: Textile BBCode Wrapper

I've written a new PunBB 1.3.x extension (Textile BBCode Wrapper) that allows the user to compose a post (or signature) using Textile markup. Once the extension is installed, a post can be written in Textile by enclosing the entire message (or signature) in the new [textile]...[/textile] BBCode tag. Existing and future posts written using standard BBCode are completely unaffected and continue to work exactly the same. But new posts written using this new [textile] BBCode tag will be parsed by the classTextile.php code and HTML will be generated according to the Textile syntax. The extension adds a new section to the BBCode help page which describes some of the supported Textile syntax.

Note that, the [textile] start tag must be the very first text in the post and the [/textile] end tag must be the very last text in the post. It is a simple extension that uses the TextileRestricted() method of the classTextile.php class that was borrowed from the Textpattern 4.0.8 distribution. This restricted subset of the Textile code should be web safe (it does not allow setting element classes or attributes, but does allow a large subset of the Textile syntax - it uses the same subset as the Textpattern.org forums). Although I've christened it with an initial version of v0.1.0, its actually been tested pretty rigorously and works without any problems on PunBB 1.3.4 (but of course I am just one tester and would appreciate feedback from any other users.)

Download it here: jmr_textile_v0.1.0_20090719.zip

Enjoy! smile
Jeff Roberson - 2009-07-19

Re: New extension: Textile BBCode Wrapper

Nice work. You have added many important BBcode tags.
But when I tested your extension, I found that tags were enabled only on one line, not on several lines.
The extension pun_bbcode supports this, and I can write tags on several lines.

3 (edited by ridgerunner 2009-07-25 00:50)

Re: New extension: Textile BBCode Wrapper

Kovalski wrote:

Nice work. You have added many important BBcode tags.
But when I tested your extension, I found that tags were enabled only on one line, not on several lines.
The extension pun_bbcode supports this, and I can write tags on several lines.

Actually, I added only one BBCode tag: [textile] (and all other BBCodes become unavailable when you use it). And this tag must be the one and only BBCode in a message, and the entire message must be enclosed in the [textile] tag. But inside this one new BBCode tag, you can use many differtent textile syntax "tags'. For example, To emphasize something, sandwich it with _underscores_ to produce: underscores. To make something bold, sandwich it in *astericks* to produce: astericks. To make a numbered list, start each list item on a new line which begins with a # pound sign -

# item one
# item two
# item three

which produces:

  1. item one

  2. item two

  3. item three

The textile syntax is quite rich and once you get to know it, faster to type. You can also created bulleted lists, headers, tables, links, images, quotes, code, subscript, superscript and more.

I am working on another version of this extension which allows you to freely mix BBCode tags with Textile. Standby...

Re: New extension: Textile BBCode Wrapper

ridgerunner wrote:

.....
For example, To emphasize something, sandwich it with _underscores_ to produce: underscores. To make something bold, sandwich it in *astericks* to produce: astericks.

But if you write the string

*astericks
versus
Cesar*

your tags will be disabled and you will only see normal strings, not in bold...
If you add this features to the next version, then it will be created! smile

Re: New extension: Textile BBCode Wrapper

Kovalski wrote:

But if you write the string

*astericks
versus
Cesar*

your tags will be disabled and you will only see normal strings, not in bold...
If you add this features to the next version, then it will be created! smile

With Textile, the *bold* and _emphasized_ tags generate HTML in-line tags (i.e. <strong> and <em>), which must be wholly contained within a block tag (i.e. <p>, <div>, <blockquote> etc). Your example contains newlines, each of which Textile interprets as a new paragraph. Thus, the *bold* and _emphasis_ Textile tags cannot span multiple paragraphs. To make your example work, you must close each tag before a newline like so...

*asterisks*
*versus*
*Cesar*

Sorry, but that's just the way the Textile cookie crumbles... smile