src/Peach/Markup/DefaultContext.php
public function handleComment(Comment $comment)
    {
        if ($this->isCommentMode) {
            $this->formatChildNodes($comment);
            return;
        }
        
        $this->isCommentMode = true;
        $prefix = $this->escapeEndComment($comment->getPrefix());
        $suffix = $this->escapeEndComment($comment->getSuffix());
        $this->result .= $this->indent() . "<!--{$prefix}";
        if ($this->isIndentMode) {
            if ($this->checkBreakModeInComment($comment)) {
                $breakCode = $this->breakCode();
                $this->result .= $breakCode;
                $this->formatChildNodes($comment);
                $this->result .= $breakCode;
                $this->result .= $this->indent();
            } else {
                $this->isIndentMode = false;
                $this->formatChildNodes($comment);
                $this->isIndentMode = true;
            }
        } else {
            $this->formatChildNodes($comment);
        }
        $this->result .= "{$suffix}-->";
        $this->isCommentMode = false;
    }
public function handleComment(Comment $comment)
    {
        if ($this->isCommentMode) {
            $this->formatChildNodes($comment);
            return;
        }
        
        $this->isCommentMode = true;
        $prefix = $this->escapeEndComment($comment->getPrefix());
        $suffix = $this->escapeEndComment($comment->getSuffix());
        $this->result .= $this->indent() . "<!--{$prefix}";
        if ($this->isIndentMode) {
            if ($this->checkBreakModeInComment($comment)) {
                $breakCode = $this->breakCode();
                $this->result .= $breakCode;
                $this->formatChildNodes($comment);
                $this->result .= $breakCode;
                $this->result .= $this->indent();
            } else {
                $this->isIndentMode = false;
                $this->formatChildNodes($comment);
                $this->isIndentMode = true;
            }
        } else {
            $this->formatChildNodes($comment);
        }
        $this->result .= "{$suffix}-->";
        $this->isCommentMode = false;
    }
public function handleComment ( Comment $ comment ) { if ( $ this -> isCommentMode ) { $ this -> formatChildNodes ( $ comment ) ; return ; } $ this -> isCommentMode = true ; $ prefix = $ this -> escapeEndComment ( $ comment -> getPrefix ( ) ) ; $ suffix = $ this -> escapeEndComment ( $ comment -> getSuffix ( ) ) ; $ this -> result .= $ this -> indent ( ) . "<!--{$prefix}" ; if ( $ this -> isIndentMode ) { if ( $ this -> checkBreakModeInComment ( $ comment ) ) { $ breakCode = $ this -> breakCode ( ) ; $ this -> result .= $ breakCode ; $ this -> formatChildNodes ( $ comment ) ; $ this -> result .= $ breakCode ; $ this -> result .= $ this -> indent ( ) ; } else { $ this -> isIndentMode = false ; $ this -> formatChildNodes ( $ comment ) ; $ this -> isIndentMode = true ; } } else { $ this -> formatChildNodes ( $ comment ) ; } $ this -> result .= "{$suffix}-->" ; $ this -> isCommentMode = false ; }
コメントノードを読み込みます.
@param Comment $comment
コメントノードを読み込みます .