Textpattern Forum

You are not logged in. Register | Login | Help

#1 2012-05-01 21:09:14

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

[textile] Textile 2.4 now available.

Hello all,

I’ve just pushed PHP-Textile 2.4.0 up to github should anyone wish to try out some of the new features. If you do try it out, please keep me informed of your successes or failures with it. Download instructions are at the end of this post.

What’s New?

Quite a lot…

  1. Support for HTML comments.
  2. Support for extended characters in URLs.
  3. Support for Redcloth-style definition lists.
  4. More robust handling of notelists and note definitions.
  5. Support for linebreaks in table cells.
  6. Support for apostrophes following abbr/acronyms.
  7. Support for ordered list continuation/start control.
  8. More robust detection of lists so that even those which are not separated from the previous text are found.
  9. Customisable format for footnote refs and marks and for notelist refs.

And here are some examples of the above to help you get started

1: Support for HTML comments.

Previously having HTML comments embedded in your textile source code could lead to broken output. You should now be able to get well formatted output even if you feed it things such as…

Here is some text with a <!-- Commented out[1] --> block.

<!-- Here is a single <span>line</span> comment block -->

<!-- Here is a whole
multiline
<span>HTML</span>
Comment
-->

2: Support for extended characters in URLs.

You can now do this…

"Übermensch":https://de.wikipedia.org/wiki/Übermensch

"äöüÄÖÜßçéáóúèàòùÉÁÓÚÈÀÒÙêÊôÔâÂûÛåÅœŒæÆøØëËïÏ with trailing slash":https://en.wikipedia.com/ä/öüÄÖÜßç/éáóúè/àòùÉÁÓÚ/ÈÀÒÙêÊôÔâÂû/ÛåÅœŒæÆøØëËïÏ/

…and get correctly formatted links. However, if your link has non-word characters at the end then you have to use textile’s link alias feature to get them correctly recognised and encoded. So for things like…

http://msdn.microsoft.net/en-us/library/cby9kycs(v=vs.80).aspx     (brackets + multiple periods)

http://ja.wikipedia.org/wiki/福島駅_(大阪府)/     (brackets)

…you would need to do this…

Contact "Microsoft":myalias1 or check out "福島駅":myalias2.

[myalias1]http://msdn.microsoft.net/en-us/library/cby9kycs(v=vs.80).aspx
[myalias2]http://ja.wikipedia.org/wiki/福島駅_(大阪府)/

3: Support for Redcloth-style definition lists.

Although PHP-textile has supported definition lists for a while, this version adds support for the redcloth definition list syntax. So you can now define lists so…

- coffee := Hot _and_ black
- tea := Also hot, but a little less black
- milk := Nourishing beverage for baby cows.
Cold drink that goes great with cookies. =:

4: More robust handling of notelists and note definitions.

Textile is pretty picky about its notedef and notelist syntax. Prevoiusly both had to be terminated with a period. As users seem to miss these out fairly regularly I’ve relaxed this and now your notedefs and notelists don’t need to end with a .

5: Support for linebreaks in table cells.

You should now have newlines converted into <br /> properly in tables now.

6: Support for apostrophes following abbr/acronyms.

Previously apostrophes following abbr/acronyms were not being encoded correctly, showing up as an open-single-quote mark. These should now work just fine…

NATO(North Atlantic Treaty Organisation)'s pretty big.

The NHS(National Health Service)' charter states...

7: Support for ordered list continuation/start control.

When starting an ordered list you can now specify the start attribute to be applied like so…

#8 Item 8
# Item 9

And if you want to continue a list’s numbering from where you previous ordered list finished you can let textile know using the continuation character…

#_ Item 10
# Item 11

8: More robust detection of lists so that even those which are not separated from the previous text are found.

I’ve relaxed the constraint that lists have to be separated from what comes before them by two newlines. So the following example will still correctly generate a list…

A list of colours.
* Red
* Green
* Blue

9: Customisable format for footnote refs and marks and for notelist refs.

Some languages need a slightly different way of showing footnote references in the main text (or indeed, marking them in the foot itself) so you can now define your own format before you include classTextile.php in your project. Please look at the commit messages here and here for more details.

Getting the file…

If you do want to try it out and have an existing installation of PW or Textpattern which use textile then you can follow these steps to get the release candidate installed…

  1. Backup your existing classTextile.php file.
  2. Download PHP-Textile v2.4.0.
  3. Save the new classTextile.php file found in the archive over your existing file.

Edit. Updated outdated download links – Gocom

Last edited by Gocom (2014-04-16 08:48:59)


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#2 2012-05-01 21:54:52

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 1,575
Website

Re: [textile] Textile 2.4 now available.

Awesome work Steve, I’ve been tracking the changes through GitHub past few days. Will give it a try out over next couple of days and see if I can break it at all.

Offline

#3 2012-05-01 21:57:07

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,383
Website

Re: [textile] Textile 2.4 now available.

This looks very interesting, Steve! I will give it a try in the weekend.


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#4 2012-05-02 07:22:48

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: [textile] Textile 2.4 now available.

#7, #_ I like mucho :)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#5 2012-05-02 08:42:20

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: [textile] Textile 2.4 now available.

merz1 wrote:

#7, #_ I like mucho :)

Great. And please let me know if the table break change fixes the bug you reported a while back.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#6 2012-05-02 11:11:32

trenc
Plugin Author
From: Cologne
Registered: 2008-02-27
Posts: 506
Website

Re: [textile] Textile 2.4 now available.

Oh whow. Really nice job, Steve.

Offline

#7 2012-05-02 13:35:26

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,821
Website

Re: [textile] Textile 2.4 now available.

Awesome work. Love the continuation ordered lists feature.

Not sure this is the right place to bring this up, but I wonder if the ordered list syntax could be extended further to add the type attribute. Off the top of my head I suppose it might work like this:

# Regular numeric list
#(class) Regular numeric with class
#4(class) Regular numeric with class, starting at 4
#i Roman numeral list
#A(class) Captial letter list, with class
#4I(class) Capital roman numerals starting at 4, with class
#_a Continuation from the previous list, as alphabetical characters

etc.

Can the ol regex be extended to allow an optional letter as well as a number, with the letter rendered as a type attribute? There’s no need to support type="1" because that is implicit, so it’s really only distinguishing between upper and lower case ‘a’ and ‘i’ as modifiers.

Am I dreaming, or is this possible to sneak in? My regex-fu has gone off the boil so my random hackings along the following lines have so far failed:

"/^([#*;:]+)(_|[\d]+)?([iIaA])?($this->lc)[ .](.*)$/s"

I tried that, pulling the new parenthical element into a $ty variable, but it just broke everything. Probably something to do with greediness, or that I’m a tube1.

If you think it’s worthwhile pursuing I’ll raise a ticket, but if you’ve tried and decided it wasn’t worth the hassle then I’ll just disappear back into my corner of cyberspace.

I’m off to play with the other stuff in this release. Thanks Steve.

1 EDIT: confirmed, I am a tube. I’d missed the regex in lists(). Works fine once that one’s modified as well.

Last edited by Bloke (2012-05-02 14:11:50)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2012-05-02 13:47:17

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: [textile] Textile 2.4 now available.

Hi Stef,

Thanks for trying this out.

Regarding the addition of the type attribute for ordered lists: this is, actually, already in the issues list and tagged as a feature request. It’s on my radar but I don’t plan on addressing it as part of the 2.4 release.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#9 2012-05-02 13:56:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,821
Website

Re: [textile] Textile 2.4 now available.

net-carver wrote:

already in the issues list

I scanned the issues list before writing the above, but somehow missed that one, sorry. I can see by reading the thread that the solution is more complicated than I originally envisaged anyway so I shall indeed slink off into the middle distance.

Last edited by Bloke (2012-05-02 13:57:33)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#10 2012-05-03 05:32:17

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 604
Website

Re: [textile] Textile 2.4 now available.

Works great overall.
Nitpick tough: your example above for Redcloth-style DL has a typo… there should be a space between the hyphen (-) and the definition term (example didn’t work at first).

- coffee := Hot _and_ black

Offline

Board footer

Powered by FluxBB