Converts markdown into HTML

@param string $content
@param TypeDoc $context
@param bool $paragraph
@return string
558449
public static function process($content, $context = null, $paragraph = false)
    {
        if (!isset(Markdown::$flavors['api-latex'])) {
            Markdown::$flavors['api-latex'] = new static;
        }

        if (is_string($context)) {
            $context = static::$renderer->apiContext->getType($context);
        }
        Markdown::$flavors['api-latex']->renderingContext = $context;

        if ($paragraph) {
            return Markdown::processParagraph($content, 'api-latex');
        } else {
            return Markdown::process($content, 'api-latex');
        }
    }
254833
public function parseNoTemplate($content) {
        $this->_content = $content;
        $this->_parseDebugStart();
        $this->_parseExtend();
        $this->_parseInclude();
        $this->_parsePath();
        $this->_parseGravatar();
        $this->_parseAsset();
        $this->_parseUrl();
        $this->_parsePhp();
        $this->_parseLang();
        $this->_parseForeach();
        $this->_parseFor();
        $this->_parseVar();
        $this->_parseVarFunc();
        $this->_parseCondition();
        $this->_parseFunction();
        $this->_parseException();
        $this->_parseMinify();
        $this->_parseDebugEnd();

        return $this->_content;
    }
359117
protected function escapeLiteral($text, $context)
	{
		if ($context === 'raw')
		{
			return $text;
		}

		$escapeMode = ($context === 'attribute') ? ENT_COMPAT : ENT_NOQUOTES;

		return htmlspecialchars($text, $escapeMode);
	}
440606
public function parse($content)
    {
        $this->parser
            ->setSafeMode(config('markdown.safe-mode', false))
            ->setUrlsLinked(config('markdown.urls', true))
            ->setMarkupEscaped(config('markdown.markups', true));

        if (config('markdown.xss', true)) {
            $content = preg_replace('/(\[.*\])\(javascript:.*\)/', '$1(#)', $content);
        }

        return $this->parser->text($content);
    }
1151834
def format_content(content):
    

    paragraphs = parse_html(content)

    first = True

    for paragraph in paragraphs:
        if not first:
            yield ""

        for line in paragraph:
            yield line

        first = False
174515
public function parseLogContext($content)
    {
        $content = trim($content);
        $pattern = "/^".self::CONTEXT_EXCEPTION_PATTERN.self::CONTEXT_MESSAGE_PATTERN.self::CONTEXT_IN_PATTERN."$/ms";

        preg_match($pattern, $content, $matchs);

        $exception = isset($matchs[1]) ? $matchs[1] : null;
        $message   = isset($matchs[2]) ? $matchs[3] : $content;
        $in        = isset($matchs[4]) ? $matchs[4] : null;
        $line      = isset($matchs[5]) ? $matchs[5] : null;

        return compact('message', 'exception', 'in', 'line');
    }
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();
    }
432646
public static function processHtml($content, callable $processor) {
    $doc = new \DOMDocument();
    $doc->loadHTML('<html>'.trim(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8')).'</html>', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
    $processor($doc);
    return trim(str_replace(['<html>', '</html>'], '', $doc->saveHTML()));
  }
275539
public static function getHtmlAttributes($content)
    {
        $content = self::getHtmlTags($content, false);

        if (!is_array($content) || empty($content)) {
            return;
        }

        $content = implode($content);

        $re = '@(\s+)(\S+)=["\']?((?:.(?!["\']?\s+(?:\S+)=|[>]))+.)["\']?@';

        preg_match_all($re, $content, $matches, PREG_SET_ORDER, 0);

        $atts = array();
        if ($matches) {
            foreach ($matches as $match) {
                $atts[$match[2]] = $match[0];
            }

            return $atts;
        }

        return;
    }
1173267
def markdown_to_html( content )    
    ## note: set to gfm (github-flavored markdown) by default
    ##   see http://kramdown.gettalong.org/parser/gfm.html
    kramdown_config = {
      'input'     => 'GFM',
      'hard_wrap' => false
    }

    puts "  Converting markdown-text (#{content.length} bytes) to HTML using kramdown library with #{kramdown_config.inspect}..."
    
    Kramdown::Document.new( content, kramdown_config ).to_html
  end
1268216
private function getHTML($count, $loremipsum)
    {
        $sentences = $this->getPlain($count, $loremipsum, false);
        $paragraphs = $this->getParagraphArr($sentences);
        //print_r($paragraphs);

        $paragraphStr = [];
        foreach ($paragraphs as $p) {
            $paragraphStr[] = "<p>\n".$this->paragraphToString($p, true).'</p>';
        }

        //add new lines for the sake of clean code
        return implode("\n", $paragraphStr);
    }
705778
protected function appendLine( string$content ):self
	{
		false===$this->indentation or $content= str_repeat($this->indentation,$this->level-$this->sectionLevel).$content."\n";

		return $this->append($content);
	}
323159
protected function createText($content)
	{
		return (trim($content) === '')
		     ? $this->createElement('xsl:text', $content)
		     : $this->ownerDocument->createTextNode($content);
	}
247340
public function build($content)
    {
        $examples = $this->parser->extractExamples($content);

        for ($i = 0; $i < count($examples); $i++)
        {
            $examples[$i] =
                "## Example #".($i + 1)."\n\n".$this->buildBlock($examples[$i]);
        }

        return "# Examples\n\n".implode("\n", $examples);
    }
875955
protected function renderElement($content = null)
    {
        // Get element parts
        $element    = $this->getElement();
        $attributes = $this->getAttributesAsString();

        // Create html
        $html = '<' . $element;
        if ($attributes) {
            $html .= $attributes;
        }

        // Create closing tag
        if (is_string($content)) {
            $html .= '>' . $content . '</' . $element;
        }
        $html .= $this->getClosingBracket();

        return $html;
    }
427645
protected function renderTag($content = null)
    {
        $attributes = $this->renderAttributes();

        if ($this->isVoid) {
            return sprintf(
                '<%1$s%2$s%3$s>',
                $this->tag,
                $attributes,
                $this->isXhtml ? ' /' : ''
            );
        }

        return sprintf(
            '<%1$s%2$s>%3$s</%1$s>',
            $this->tag,
            $attributes,
            $content
        );
    }
670803
public function appendHtmlContent(string $content) : Tag
    {
        if ($this->isVoid) {
            throw new \LogicException('Void elements cannot have any contents.');
        }

        $this->content .= $content;

        return $this;
    }