On Jun 3, 12:10 pm, Etam <
odwrot...@gmail.com> wrote:
> Hi,
>
> I am trying to write something like this:
>
> <span class="lift:trimmer.trimChars?length=3"><p>This tex will be
> trimmed</p></span>
>
> class Trimmer {
> def trimChars = {
> val length: Int = S.param("length").dmap(3)(_.toInt)
> "*" #> ((ns: NodeSeq) => {
> val text = ns.text
> if (text.length <= length)
> Text(text)
> else
> Text(text.substring(0, length))
>
> })
> }
> }
>
> to trim long text in templates.
>
> Is it possible to adjust the method to use it in another snippet, like:
>
> <div class="article">