Пример #1
0
 /**
  * Filters the given content.
  */
 public static function filter(Node $node)
 {
     foreach ($node->content as &$line) {
         $line = str_repeat($node->indent_string(), 2) . $line;
     }
     $q = $node->option('attr_wrapper');
     array_unshift($node->content, "<script type={$q}text/javascript{$q}>", $node->indent_string() . '//<![CDATA[');
     array_push($node->content, $node->indent_string() . '//]]>', '</script>');
     return $node->content;
 }
Пример #2
0
 /**
  * Filters the given content.
  */
 public static function filter(Node $node)
 {
     foreach ($node->content as &$line) {
         $line = str_repeat($node->indent_string(), 2) . $line;
     }
     $q = $node->option('attr_wrapper');
     array_unshift($node->content, "<style type={$q}text/css{$q}>", $node->indent_string() . '/*<![CDATA[*' . '/');
     array_push($node->content, $node->indent_string() . '/*]]>*/', '</style>');
     return $node->content;
 }
Пример #3
0
 /**
  * Instantiates the RubyValue and determines its type and content.
  */
 public function __construct($value, Node $node)
 {
     if ($value[0] == ':') {
         if (!preg_match('/^:[a-z0-9]+/i', $value)) {
             $node->exception('Parse error: invalid character in symbol');
         }
         $this->content = substr($value, 1);
     } else {
         $this->content = $value;
     }
 }