Render text and html into the given content.

@param string &$content
@param string $text
@param string $html
@param string $encoding
@param string $boundary
344029
private function renderTextAndHtml(&$content, $text, $html, $encoding, $boundary)
    {
        $uid = uniqid();
        $boundary2 = "x----_=_NextPart_003_$uid";
        $content .= "\r\n--$boundary\r\n";
        $content .= "Content-Type: multipart/alternative;\r\n\tboundary=\"$boundary2\"\r\n";
        $this->renderPlainText($content, $text, $encoding, $boundary2);
        $this->renderHtml($content, $html, $encoding, $boundary2);
        $content .= "\r\n--$boundary2--\r\n";
    }
724562
private String convertOutputToHtml(String content) {

        if (content.length() == 0) {
            return "";
        }
        StringBuilder buffer = new StringBuilder();
        for (String line : content.split("\n")) {
            buffer.append(CmsEncoder.escapeXml(line) + "<br>");
        }
        return buffer.toString();
    }
507840
public function setBody($html, $text = null)
    {
        $this->_htmlBody = $html;
        $this->_textBody = $text;

        return $this;
    }
556838
protected function parserContent($boundary, $content)
    {
        if ($boundary) {
            $parts = preg_split('#--'.$boundary.'(--)?\s*#si', $content, -1, PREG_SPLIT_NO_EMPTY);
            foreach ($parts as $part) {
                $part = trim($part);
                if (empty($part)) {
                    continue;
                }

                if (preg_match('/(Content-Type:)(.*)/i', $part, $math)) {
                    if (preg_match(Headers::BOUNDARY_PATTERN, str_replace("\r\n\t", ' ', $part), $subBoundary)) {
                        if ($subBoundary[1] != $boundary) {
                            $this->parserContent($subBoundary[1], $part);
                        } else {
                            continue;
                        }
                    } else {
                        $data = explode(';', $math[2]);
                        $type = trim($data[0]);

                        $isAttachment = (strpos($part, 'Content-Disposition: attachment;') !== false);

                        //get body message
                        if (($type == Content::CT_MULTIPART_ALTERNATIVE || $type == Content::CT_TEXT_HTML || $type == Content::CT_TEXT_PLAIN
                                || $type == Content::CT_MESSAGE_DELIVERY)
                            && !$isAttachment
                        ) {
                            $this->parserBodyMessage($part);
                        } elseif ($type == Content::CT_MESSAGE_RFC822) {
                            $this->parserBodyMessage($part);
                            $this->parserAttachment($part);
                        } else { //attachment
                            $this->parserAttachment($part);
                        }
                    }
                }
            }
        } else {
            $content = new Content();
            $content->content = $this->_content;
            $content->charset = $this->_header->getCharset();
            $content->contentType = $this->getHeaders()->getMessageContentType();
            $content->transferEncoding = $this->_header->getTransferEncoding();

            $this->_parts[] = $content;
        }
    }
399078
public function setBodyHtml($html, $charset = null, $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE)
    {
        if ($charset === null) {
            $charset = $this->_charset;
        }

        $mp = new Zend_Mime_Part($html);
        $mp->encoding = $encoding;
        $mp->type = Zend_Mime::TYPE_HTML;
        $mp->disposition = Zend_Mime::DISPOSITION_INLINE;
        $mp->charset = $charset;

        $this->_bodyHtml = $mp;

        return $this;
    }
699158
public void respond(String html) throws IOException, ServletException {
        response.setContentType("text/html");
        response.getWriter().print(html);
    }
881570
private function _transform($encoding, $data)
    {
        switch($encoding) {
        case 'none' :
            header('Content-Type: text/html');
            return $this->_renderer->render($data);
        case 'json' :
            header('Content-Type: application/json');
            $output = array();
            $output['code'] = 200;
            $output['message'] = $this->_renderer->render($data);
            return json_encode($output);
        default :
            return $data;
        }

    }
170777
def html(content, **kwargs):
    """"""
    if hasattr(content, 'read'):
        return content
    elif hasattr(content, 'render'):
        return content.render().encode('utf8')

    return str(content).encode('utf8')
327980
public function renderContentBegin() {
		
		echo CHtml::openTag('div', $this->contentHtmlOptions);
		if (!empty($this->content)) {
			echo $this->content;
		}
	}
1044595
function(content) {
      if(typeof content == "string") {
         this.bodyEl.innerHTML = content;
      }
      else {
         this.bodyEl.innerHTML = "";
         this.bodyEl.appendChild(content);
      }
   }
1009426
protected function _renderTag($attribs = array(), $content = null)
    {
        unset($attribs['content']);
        unset($attribs['separator']);

        $attribs = $this->buildAttributes($attribs);

        if($this->getConfig()->escape) {
            $content = $this->getTemplate()->escape($content);
        }

        $html = '<title '.$attribs.'>'.$content.'</title>'."\n";
        return $html;
    }
328719
public static function convertToHtmlEntities($string, $encoding)
    {
        if (function_exists('mb_convert_encoding')) {
            return mb_convert_encoding($string, 'HTML-ENTITIES', $encoding);
        }

        if ('UTF-8' !== $encoding) {
            $string = iconv($encoding, 'UTF-8//IGNORE', $string);
        }

        return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'htmlEncodingCallback'], $string);
    }
1064048
protected function PrintOut($text,$contentType = null)
	{
		if ($this->CaptureOutputMode)
		{
			$this->DebugOutput .= $text;
		}
		else
		{
			if ($contentType) header("Content-type: " . $contentType);
			print $text;
		}
	}
677581
protected function encode($from, $text, $html, $whole = true)
    {
        $html = str_replace($from . ' ', $text . ' ', $html);

        $html = str_replace(' ' . $from, ' ' . $text, $html);

        $html = str_replace('>' . $from, '>' . $text, $html);

        $html = str_replace($from . '<', $text . '<', $html);

        return $whole ? str_replace($from, $text, $html) : $html;
    }
221368
public function process(&$content)
    {
        //Add resources to the content
        $begin = "";
        $end = "";

        foreach ($this->tags as $tag) {
            if ($tag["at"]=="begin") {
                $begin.=$this->renderTag($tag);
            } else {
                $end.=$this->renderTag($tag);
            }
        }

        if ($begin!=='') {
            $count=0;
            $content=preg_replace(
                '/(<body\b[^>]*>)/is',
                '$1<###begin###>',
                $content,
                1,
                $count
            );
            if ($count) {
                $content=str_replace('<###begin###>', $begin, $content);
            } else {
                $content=$begin.$content;
            }
        }

        if ($end!=='') {
            $count=0;
            $content=preg_replace(
                '/(<\\/body\s*>)/is',
                '<###end###>$1',
                $content,
                1,
                $count
            );
            if ($count) {
                $content=str_replace('<###end###>', $end, $content);
            } else {
                $content=$content.$end;
            }
        }
    }
323366
public function full_tag($tag, $content = null, $attributes = null) {
        $content = $this->text_content($content); // First of all, apply transformations
        $this->nullcontent = is_null($content) ? true : false; // Is it null content
        $this->begin_tag($tag, $attributes);
        if (!$this->nullcontent) {
            $this->write($content);
            $this->lastwastext = true;
            $this->end_tag($tag);
        }
    }
752162
public function escapeHtml($string, $encoding = 'utf-8') {
		
		$current = Escape :: getEncoding();
		Escape :: setEncoding($encoding);
		$result =  Escape :: html($string);
		Escape :: setEncoding($current);

		return $result;
	}