Render a Text MessageElement as html

        Args:
            None

        Returns:
            Str the html representation of the Text MessageElement

        Raises:
            Errors are propagated
193051
def to_html(self):
        
        if self.items is None:
            return
        else:
            html = '<ol%s>\n' % self.html_attributes()
            for item in self.items:
                html += '<li>%s</li>\n' % item.to_html()
            html += '</ol>'
            return html
426418
def render_text(text, preformatted=False):
  
  return IPython.core.display.HTML(_html.HtmlBuilder.render_text(text, preformatted))
556463
def raw_html(self) -> _RawHTML:
        
        if self._html:
            return self._html
        else:
            return etree.tostring(self.element, encoding='unicode').strip().encode(self.encoding)
227210
def render_html_tree(tree):
    

    # Restore any tag names that were changed in get_html_tree()
    for el in tree.iter():
        if '__tag_name' in el.attrib:
            actual_tag_name = el.attrib.pop('__tag_name')
            el.tag = actual_tag_name

    html = lxml.html.tostring(tree, encoding='utf8').decode('utf8')

    return strip_wrapping(html)
644336
def rendered_text(self):
        
        if len(self._plain_images) <= 0:
            self._convert_images()

        if self._animation is None:
            index = self._index
            self._index += 1
            if self._index >= len(self._plain_images):
                self._index = 0
        else:
            index = self._animation()
        return (self._plain_images[index],
                self._colour_map[index])
513454
public static function renderMessages() : string {
		$result = '';
		// we need to see if we have postponed messages and render them first
		$postponed = Session::get(['numbers', 'messages']);
		if (!empty($postponed)) {
			Session::set(['numbers', 'messages'], []);
			foreach ($postponed as $k => $v) {
				$result.= \HTML::message(['options' => $v, 'type' => $k]);
			}
		}
		// regular messages
		$messages = Application::get(array('messages'));
		if (!empty($messages)) {
			foreach ($messages as $k => $v) {
				$result.= \HTML::message(['options' => $v, 'type' => $k]);
			}
		}
		return $result;
	}
769874
function render(element, opts) {
    opts = opts || {};

    var prepend = opts.prepend;
    var model = opts.model || {};
    var indentLevel = opts.indentLevel || 0;
    var isPretty = opts.isPretty;
    var jtPrintIndent = isPretty ? '\t' : '';
    var jtPrintNewline = isPretty ? '\n' : '';
    var indent = '', i, len, prop;
    var p = [];  // p is going to be our concatenator for the HTML string

    // if no element, then no HTML so return empty string
    if (!element) { return ''; }

    // if already a string, just return it
    if (utils.isString(element)) { return element; }

    // if an array, wrap it
    if (utils.isArray(element)) { element = naked(element, null); }

    // set the indentation level to the current indent
    if (isPretty && indentLevel) {
        for (i = 0; i < indentLevel; i++) {
            indent += jtPrintIndent;
        }
    }

    // if we are prepending some string, add it first
    if (prepend) {
        p.push(indent, prepend, jtPrintNewline);
    }

    // starting tag open
    if (element.tag) {
        p.push(indent, '<', element.tag);
    }

    // all tag attributes
    if (element.attributes) {
        for (prop in element.attributes) {
            if (element.attributes.hasOwnProperty(prop)) {

                if (element.attributes[prop] === null) {
                    p.push(' ', prop);
                }
                else {
                    p.push(' ', prop, '="', element.attributes[prop], '"');
                }
            }
        }
    }

    // if no children or text, then close the tag
    if (element.tag && !element.children && (element.text === undefined || element.text === null)) {

        // for self closing we just close it, else we add the end tag
        if (selfClosing.indexOf(element.tag) > -1) {
            p.push('/>', jtPrintNewline);
        }
        else {
            p.push('></', element.tag, '>', jtPrintNewline);
        }
    }
    // else we need to add children or the inner text
    else {

        // if a tag (i.e. not just a string literal) put end bracket
        if (element.tag) { p.push('>'); }

        // if children, we will need to recurse
        if (element.children) {
            if (element.tag) { p.push(jtPrintNewline); }

            // recurse down for each child
            for (i = 0, len = element.children.length; i < len; ++i) {
                p.push(render(element.children[i], {
                    indentLevel:    element.tag ? indentLevel + 1 : indentLevel,
                    isPretty:       isPretty,
                    model:          model
                }));
            }

            if (element.tag) { p.push(indent); }
        }

        // if text, simply add it
        if (element.text !== null && element.text !== undefined) { p.push(element.text); }

        // finally if a tag, add close tag
        if (element.tag) {
            p.push('</', element.tag, '>', jtPrintNewline);
        }
    }

    return p.join('');
}
93122
def render_html(self, request, instance, context):
        
        render_template = self.get_render_template(request, instance, email_format='html')
        if not render_template:
            return str(u"{No HTML rendering defined for class '%s'}" % self.__class__.__name__)

        instance_context = self.get_context(request, instance, email_format='html', parent_context=context)
        instance_context['email_format'] = 'html'

        html = self.render_to_string(request, render_template, instance_context)
        if self.render_replace_context_fields:
            html = replace_fields(html, instance_context)  # pass safe-string
        return html
871263
def convert_msg_to_html(msg):
    """"""

    msg = re.sub("\n", "<br />", msg, flags=re.MULTILINE)
    return msg
1304918
def text(self):
        
        return self.template.format(name=self.name, type=self.type)
807668
def render_as_text(self, limit=None):
        """"""
        lines = traceback.format_exception(self.exc_type, self.exc_value,
                                           self.frames[0], limit=limit)
        return ''.join(lines).rstrip()
1158327
def render_message(self):
        
        message = None
        if self.title:
            message = '标题：{0}'.format(self.title)
        if self.message_time:
            message = '{0}\n时间：{1}'.format(message, self.time)
        if message:
            message = '{0}\n内容：{1}'.format(message, self.content)
        else:
            message = self.content
        return message
1013916
def render(self, text, auth=None):
        
        if markdown is None:
            import markdown
        if UrlizeExtension is None:
            from .mdx_urlize import UrlizeExtension
        return markdown.markdown(text, extensions=[
            'fenced_code',
            'codehilite(css_class=highlight)',
            'toc',
            'tables',
            'sane_lists',
            UrlizeExtension(),
        ])
228884
def pretty_render(data, format='text', indent=0):
    
    if format == 'json':
        return render_json(data)
    elif format == 'html':
        return render_html(data)
    elif format == 'xml':
        return render_xml(data)
    else:
        return dict_to_plaintext(data, indent=indent)
795962
def render_text(text, preformatted=False):
    
    builder = HtmlBuilder()
    builder._render_text(text, preformatted=preformatted)
    return builder._to_html()
1334929
def render
      result = {:text => @generator.to_s, :content_type => Mime::JS}

      # iframed uploads context overloading
      if @template.request.content_type == 'multipart/form-data'
        result[:content_type] = Mime::HTML
        result[:layout]       = nil
        result[:text]         = %Q{
<!-- iframed uploads JS responses layout -->
<html>
  <head>
    <script type="text/javascript">
      with (window.parent) {
        #{result[:text]}
      }
    </script>
  </head>
</html>
        }.strip
      end

      result.merge! @options
    end
154612
def render_error_page(code, exc, mimetype='text/html', traceback=''):
    
    from giotto.views import get_jinja_template

    if 'json' in mimetype:
        return json.dumps({
            'code': code,
            'exception': exc.__class__.__name__,
            'message': str(exc),
        })

    et = get_config('error_template')
    if not et:
        return "%s %s\n%s" % (code, str(exc), traceback)
    template = get_jinja_template(et)
    return template.render(
        code=code,
        exception=exc.__class__.__name__,
        message=str(exc),
        traceback=traceback
    )