TextiLite - Another lightweight version of Textile - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: TextiLite - Another lightweight version of Textile (/showthread.php?tid=8028) |
TextiLite - Another lightweight version of Textile - El Forum - 05-01-2008 [eluser]evanwalsh[/eluser] I decided to make a version of Textile that only supported a small set of HTML tags because I needed it for a forum app I'm making. Here's the code for the library: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Installation: Copy the above code into a file named Textilite.php in your app's libraries folder Usage: Code: $this->load->library("textilite"); This would render: Code: <p><strong>Test</strong></p> Tell me what you think. I have encountered some errors and I plan on fixing them very, very soon. TextiLite - Another lightweight version of Textile - El Forum - 05-02-2008 [eluser]Lone[/eluser] Thanks for the link to our minitextile and I just wanted to make a couple of comments. First of all I am just curious as to why to make a new library rather then suggestions on our own - the reason I ask is not because we don't want another but just curious as to whether you found in many flaws in our own. Infact I ran a quick test between ours and yours and saw a definite speed increase (when looped 10000 times) in yours compared to ours. I also really like that array usuage for the preg_replace! Didnt know you could do that However that does steep me into the next comment, the string I tested it on for yours actually intepreted it incorrectly.. below is the string: Code: $sample = And here is the output (note the extra <br /> after the <p> tag Code: <p>This is some <strong>sample</strong> text to As ours was slower I wonder if it was because ours was able to interpret better and hence needed more overhead? TextiLite - Another lightweight version of Textile - El Forum - 05-02-2008 [eluser]evanwalsh[/eluser] I am aware that line breaks and such aren't handled correctly. Also, putting a link and an image in the same line can mess things up, too. My library combines yours and the BBCode helper, so I thought it was too different to suggest changes. However, I am willing to figure out a way to make these changes and incorporate them into your library. Your work did inspire me a great deal, so I suppose I owe it to you. Thanks for letting me know what you think EDIT: I fixed the line breaks and the image issue, to my knowledge |