Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorJeff
    • CommentTimeSep 8th 2007
     

    Hello all, I'm new to Akelos and it's pretty sweet I have to say! :)

    I was following the video tutorial but I noticed that textile calls can't easily be escaped. For example, doing this:

    <p><%= textilize escape_once(post.body) %></p>

    Will return something like this (when post.body is blah blah <b>blah</b>):

    <p>blah blah <strong>blah</strong></p>

    when it should be something like:

    <p>blah blah &lt;strong&gt;blah&lt;/strong&gt;</p>

    For a temporary solution, I replaced the original textile lib in vendor/TextParsers/Textile.php with TextilePHP. With some minor tweaking to make sure that TextilePHP's method calls match what Akelos' is expecting and adding: "error_reporting(E_ALL ^ E_NOTICE);" in the front of all the constructor code.

    Of course, I could be entirely wrong and there's something to escape the tags correctly.

    Thanks, Jeff

    ps - Is the implementation of html_escape / h planned?

    •  
      CommentAuthorbermi
    • CommentTimeSep 9th 2007
     

    Hi Jeff,

    Welcome to the Akelos forum!

    I didn't realize till now that Textile.php unescapes escaped entities by default. I've updated TextHelper::textilize and now it behaves as expected. You can safely remove your Textile.php file and update your working copy.

    Additionally I have added support for html_escape and h.

    Now this should work for you

    <p><%= textilize h(post.body) %></p>
    

    enjoy Akelos :)

    • CommentAuthorJeff
    • CommentTimeSep 10th 2007
     
    Cool, thanks! :)
Add your comments
    Username Password
  • Format comments as