diff -r 000000000000 -r b40ca010c49c textile.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/textile.lua Mon May 18 01:21:10 2009 +0100 @@ -0,0 +1,14 @@ +module("textile", package.seeall) + + +return function (textile) + if not textile then + error("textile: nil data!"); + end + textile = textile:gsub("_(.-)_", "%1"):gsub("%*(.-)%*", "%1"); + textile = textile:gsub("h(%d+)%. ([^\r\n]+)", "%2"); + textile = textile:gsub("p%. ([^\r\n]+)", "

%1

"); + textile = textile:gsub("p%((%w+)%)%. ([^\r\n]+)", "

%2

"); + textile = textile:gsub("[\r\n](.-)[\r\n]", "

%1

"); + return textile; +end