コード例 #1
0
ファイル: Printer.php プロジェクト: gunderjt/MtHaml
 public function enterText(Text $node)
 {
     $content = $node->getContent();
     $escaping = $node->getEscaping();
     if (true === $escaping->isEnabled()) {
         $flag = '&';
         if ($node->getEscaping()->isOnce()) {
             $flag .= '!';
         }
         $content = $flag . $content;
     } elseif (false === $escaping->isEnabled()) {
         $content = '!' . $content;
     }
     $this->raw('text(' . $content . ')');
 }
コード例 #2
0
 public function enterText(Text $node)
 {
     $string = $node->getContent();
     if ($this->isEchoMode()) {
         if ($node->getEscaping()->isEnabled()) {
             $once = $node->getEscaping()->isOnce();
             $string = $this->escapeHtml($string, !$once);
         }
         $string = $this->escapeLanguage($string);
         $this->raw($string);
     } else {
         $string = $this->stringLiteral($string);
         $this->raw($string);
     }
 }