This commit moves the markup caching into Liquid rendering. As
Liquid allows to return different results depending on the environment
(variables, logged user, ...) we only cache the page if it contains
no active content.
Unfortunetely, active content currently also includes the TOC
in wiki pages.
These filters change the implemntation of sub and gsub to use the block method.
This prevents the evaluation of backreferences in the replacement text. See
https://gist.github.com/1491437 for examples.
Also, it allows split to be called without arguments to split strings on
whitespace.
This is not only a wee bit faster (yay!) but also allows use to deal with
frozen strings and doesn't change content which might inadvertently be saved
later on. And it fixes some broken tests on Ruby 1.9 :)
This changes how the liquid integration works. It now integrates the Textile
conversion step. This was necessary because if you first convert the snippets
inside of loops and conditionals from Textile to HTML, you loose some
important context information which is required to e.g. build proper lists in
textile.
We expect the standard case that Liquid tags return Textile markup instead
of HTML. Thus, we can convert the final textile markup to HTML as a very last
step.
To allow existing and new macros (or tags) to return HTML for advanced usage,
we save their respective output into the context and put a placeholder string
into the generated markup. After the transformation to HTML, we insert the
previously generated HTML into the string using search+replace in
lib/chili_project/liquid/template.rb. Tags have to be registered using
:html => true for this special treatment.