예제 #1
0
function _RunSpanGamut($text)
{
    #
    # These are all the transformations that occur *within* block-level
    # tags like paragraphs, headers, and list items.
    #
    global $md_empty_element_suffix;
    $text = _DoCodeSpans($text);
    $text = _EscapeSpecialChars($text);
    # Process anchor and image tags. Images must come first,
    # because ![foo][f] looks like an anchor.
    $text = _DoImages($text);
    $text = _DoAnchors($text);
    # Make links out of things like `<http://example.com/>`
    # Must come after _DoAnchors(), because you can use < and >
    # delimiters in inline links like [this](<url>).
    $text = _DoAutoLinks($text);
    # Fix unencoded ampersands and <'s:
    $text = _EncodeAmpsAndAngles($text);
    $text = _DoItalicsAndBold($text);
    # Do hard breaks:
    $text = preg_replace('/ {2,}\\n/', "<br{$md_empty_element_suffix}\n", $text);
    return $text;
}
function _RunSpanGamut($text)
{
    global $g_empty_element_suffix;
    $text = _DoCodeSpans($text);
    $text = _EncodeAmpsAndAngles($text);
    $text = _DoImages($text);
    $text = _DoAnchors($text);
    $text = _DoItalicsAndBold($text);
    # Do hard breaks:
    $text = preg_replace('/ {2,}\\n/', "<br{$g_empty_element_suffix}\n", $text);
    return $text;
}
function _RunSpanGamut($text)
{
    #
    # These are all the transformations that occur *within* block-level
    # tags like paragraphs, headers, and list items.
    #
    global $md_empty_element_suffix;
    $text = _DoCodeSpans($text);
    # Fix unencoded ampersands and <'s:
    $text = _EncodeAmpsAndAngles($text);
    # Process anchor and image tags. Images must come first,
    # because ![foo][f] looks like an anchor.
    $text = _DoImages($text);
    $text = _DoAnchors($text);
    $text = _DoItalicsAndBold($text);
    # Do hard breaks:
    $text = preg_replace('/ {2,}\\n/', "<br{$md_empty_element_suffix}\n", $text);
    return $text;
}