Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorJeff

    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?


    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
    Cool, thanks! :)