Jump to content

Calling for textile testers


netcarver
 Share

Recommended Posts

Folks, I've been working on an experimental re-write of the link & image handling code in textile as I've become increasingly annoyed with the existing code. If you don't know what textile is then pass this over but if you do know what I'm talking about could you try out the code from the link-detection-rewrite branch and see if it improves or breaks anything for you?

Thanks in advance!

  • Like 2
Link to comment
Share on other sites

Hi arjen,

if you are using the TextformatterTextile module then you could try this...

  • Go to site/modules/TextformatterTextile* and rename classTextile.php to classTextile.orig.php
  • Click this link and save the file as classTextile.php in site/modules/TextformatterTextile*

*Adjust exact path as needed

You should now be able edit any page using the new version of textile and see if it produces changes (for better or worse.)

Edited to add: diogo got there first!

Link to comment
Share on other sites

I think we are very lucky here to have the maintainer of Textile [Netcarver] using ProcessWire. I started using Textile late in the game, but now that I use it regularly, I like it so much better than Markdown. I wish that I had bundled Textile in the PW core in addition to (or rather than) Markdown. Though if I do it now, then it'll conflict with the /site/modules/ version that anyone already has installed, so would have to come up with a different name for the TextformatterTextile modules.

@netcarver, are you interested in managing the TextformatterTextile and TextformatterTextileRestricted modules? These modules basically consist of 1 function all, so there isn't really anything to maintain in them except for the classTextile.php version. If you would like to, let me know and I'll just change the ownership of the modules.processwire.com listing to you so that you can re-point it to your own repo. I'm guessing this would ensure the best consistency between the PW module and classTextile versions. Otherwise, I'm happy to keep them in my GitHub account, but figured I should offer it since you are the maintainer of Textile itself, not to mention a great PW module developer.

Link to comment
Share on other sites

@netcarver and @diogo: thanks. Too easy actually.

Works fine here. I tested links with or without classes, with or without titles, with or without images and all seem to work fine.

I started using Textile late in the game, but now that I use it regularly, I like it so much better than Markdown.

I think it's way more readable than Markdown. It's humane. From my experience people (including developers and designers) coming from wysiwyg editors seem to be scared at first seeing Markdown or Textile. When it comes to learning, Textile is easier adopted than Markdown and by most even prefered over wysiwyg editors. So indeed it's really great to have Netcarver here!

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hello,

I am using Textile in my site now. I like the options it provides.

However, for some reason it is not rendering unordered lists properly in the "restricted" version.

I apologize if this has been reported already, but here's my scenario...

1. I placed the TextformatterTextileRestricted.module, TextformatterTextile.module, and classTextile.php files in the sites/modules directory

2. I installed the Textile and TextileRestricted modules from the ProcessWire module manager

3. I created a textarea field and applied the "Textile Restricted" formatter in the "Details" screen

4. I enter the following text in a textarea field:

*Publications*

* Publication 1

* Publication 2

*Honors*

* Honor 1

* Honor 2

The browser result is asterisks instead of <li>:

Publications

* Publication 1

* Publication 2

Honors

* Honor 1

* Honor 2

If I do exactly the same thing with the plain "Textile" formatter, it works properly and I get nice <li> elements.

Thanks,

Matthew

Link to comment
Share on other sites

@Mathew

Thank you for the report, I appreciate it!

Actually, TextileRestricted() intentionally does not convert these structures to lists. It's restrictive as it's meant to be used for things like public facing inputs like comments which can easily be abused. As you've found out already, you need to use the normal unrestricted textile if you want lists rendered properly.

As a slight aside for a moment: You mentioned using...

*Publications*
* Publication 1
* Publication 2

...as the input but this version of textile requires a newline between what you are using as a heading and the first item in the list, like this...

*Publications*

* Publication 1
* Publication 2

Ok, back to the main thrust. If this isn't a public facing application and you need to have users input lists then you could consider switching over to the un-restricted formatter. If you do need restricted mode (untrusted users) plus lists then please raise an issue over on the repo and I'll see what I can do.

I'm not particularly happy with this split between functionality between the two textile methods at present although it seems to have done what most people need until now. I have been thinking of adding a more general and flexible parse method to which you can specify exactly what structures should be allowed, but that's just a thought at the moment.

Thank you for your interest in textile.

Link to comment
Share on other sites

Hello netcarver,

Thank you very much for responding...

I switched to using the "normal" Textile, and everything is working great now. In fact, I discovered an additional benefit: Textile adds <p> linebreaks on "return" key entries, so we don't have to use an additional module to make that happen in the textarea fields.

This is actually my first time really using Textile. It offers a terrific balance of giving end-users crucial formatting optoions, without resorting to problematic WYSIWYG editors.

Great work on Textile! And it's excellent you are part of the ProcessWire community.

Thanks,

Matthew

  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...