Sha256: 5ed611856b2e7bd6eba412e0e23ffff81d90596a7be12c300bb692276ac59881

Contents?: true

Size: 630 Bytes

Versions: 10

Compression:

Stored size: 630 Bytes

Contents

<?php

namespace MtHaml\Filter;

use MtHaml\NodeVisitor\RendererAbstract as Renderer;
use MtHaml\Node\Filter;

class Javascript extends Plain
{
    public function optimize(Renderer $renderer, Filter $filter, $options)
    {
        $renderer->write('<script type="text/javascript">');
        if ($options['cdata'] === true) {
            $renderer->write('//<![CDATA[');
        }

        $renderer->indent();
        $this->renderFilter($renderer, $filter);
        $renderer->undent();

        if ($options['cdata'] === true) {
            $renderer->write('//]]>');
        }
        $renderer->write('</script>');
    }
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
guard-mthaml-0.4.0 vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php
guard-mthaml-0.3.1 vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php
guard-mthaml-0.3.0 vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php
guard-mthaml-0.2.5 vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php
guard-mthaml-0.2.4 vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php
guard-mthaml-0.2.3 vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php
guard-mthaml-0.2.2 vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php
guard-mthaml-0.2.1 vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php
guard-mthaml-0.2.0 vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php
guard-mthaml-0.1.0 vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php