PHP Class org\parser\driver\Markdown

Datei anzeigen Open project: top-think/thinkphp-extend

Public Properties

Property Type Description
$empty_element_suffix # Change to ">" for HTML output.
$no_entities
$no_markup # Change to true to disallow markup or entities.
$predef_titles
$predef_urls # Predefined urls and titles for reference links and images.
$tab_width

Protected Properties

Property Type Description
$block_gamut
$document_gamut
$em_relist
$em_strong_prepared_relist
$em_strong_relist
$escape_chars # Table of hash values for escaped characters:
$escape_chars_re
$html_hashes
$in_anchor # Status flag to avoid invalid nesting.
$list_level
$nested_brackets_depth # Needed to insert a maximum bracked depth while converting to PHP.
$nested_brackets_re
$nested_url_parenthesis_depth
$nested_url_parenthesis_re
$span_gamut
$strong_relist
$titles
$urls # Internal hashes used during transformation.
$utf8_strlen # hanlde UTF-8 if the default function does not exist.

Public Methods

Method Description
__construct ( )
defaultTransform ( $text ) ### Simple Function Interface ###
parse ( string $content ) : string 提供给ThinkPHP外部调用的方法,麦当苗儿为ThinkPHP添加

Protected Methods

Method Description
_detab_callback ( $matches )
_doAnchors_inline_callback ( $matches )
_doAnchors_reference_callback ( $matches )
_doAutoLinks_email_callback ( $matches )
_doAutoLinks_url_callback ( $matches )
_doBlockQuotes_callback ( $matches )
_doBlockQuotes_callback2 ( $matches )
_doCodeBlocks_callback ( $matches )
_doHardBreaks_callback ( $matches )
_doHeaders_callback_atx ( $matches )
_doHeaders_callback_setext ( $matches )
_doImages_inline_callback ( $matches )
_doImages_reference_callback ( $matches )
_doLists_callback ( $matches )
_hashHTMLBlocks_callback ( $matches )
_initDetab ( )
_processListItems_callback ( $matches )
_stripLinkDefinitions_callback ( $matches )
_unhash_callback ( $matches )
detab ( $text )
doAnchors ( $text )
doAutoLinks ( $text )
doBlockQuotes ( $text )
doCodeBlocks ( $text )
doHardBreaks ( $text )
doHeaders ( $text )
doHorizontalRules ( $text )
doImages ( $text )
doItalicsAndBold ( $text )
doLists ( $text )
encodeAmpsAndAngles ( $text )
encodeAttribute ( $text )
encodeEmailAddress ( $addr )
formParagraphs ( $text )
handleSpanToken ( $token, &$str )
hashBlock ( $text )
hashHTMLBlocks ( $text )
hashPart ( $text, $boundary = 'X' )
makeCodeSpan ( $code )
outdent ( $text )
parseSpan ( $str )
prepareItalicsAndBold ( )
processListItems ( $list_str, $marker_any_re )
runBasicBlockGamut ( $text )
runBlockGamut ( $text )
runSpanGamut ( $text )
setup ( )
stripLinkDefinitions ( $text )
teardown ( )
transform ( $text )
unhash ( $text )

Method Details

__construct() public method

public __construct ( )

_detab_callback() protected method

protected _detab_callback ( $matches )

_doAnchors_inline_callback() protected method

protected _doAnchors_inline_callback ( $matches )

_doAnchors_reference_callback() protected method

protected _doAnchors_reference_callback ( $matches )

_doBlockQuotes_callback() protected method

protected _doBlockQuotes_callback ( $matches )

_doBlockQuotes_callback2() protected method

protected _doBlockQuotes_callback2 ( $matches )

_doCodeBlocks_callback() protected method

protected _doCodeBlocks_callback ( $matches )

_doHardBreaks_callback() protected method

protected _doHardBreaks_callback ( $matches )

_doHeaders_callback_atx() protected method

protected _doHeaders_callback_atx ( $matches )

_doHeaders_callback_setext() protected method

protected _doHeaders_callback_setext ( $matches )

_doImages_inline_callback() protected method

protected _doImages_inline_callback ( $matches )

_doImages_reference_callback() protected method

protected _doImages_reference_callback ( $matches )

_doLists_callback() protected method

protected _doLists_callback ( $matches )

_hashHTMLBlocks_callback() protected method

protected _hashHTMLBlocks_callback ( $matches )

_initDetab() protected method

protected _initDetab ( )

_processListItems_callback() protected method

protected _processListItems_callback ( $matches )

_stripLinkDefinitions_callback() protected method

protected _stripLinkDefinitions_callback ( $matches )

_unhash_callback() protected method

protected _unhash_callback ( $matches )

defaultTransform() public static method

### Simple Function Interface ###
public static defaultTransform ( $text )

detab() protected method

protected detab ( $text )

doAnchors() protected method

protected doAnchors ( $text )

doBlockQuotes() protected method

protected doBlockQuotes ( $text )

doCodeBlocks() protected method

protected doCodeBlocks ( $text )

doHardBreaks() protected method

protected doHardBreaks ( $text )

doHeaders() protected method

protected doHeaders ( $text )

doHorizontalRules() protected method

protected doHorizontalRules ( $text )

doImages() protected method

protected doImages ( $text )

doItalicsAndBold() protected method

protected doItalicsAndBold ( $text )

doLists() protected method

protected doLists ( $text )

encodeAmpsAndAngles() protected method

protected encodeAmpsAndAngles ( $text )

encodeAttribute() protected method

protected encodeAttribute ( $text )

encodeEmailAddress() protected method

protected encodeEmailAddress ( $addr )

formParagraphs() protected method

protected formParagraphs ( $text )

handleSpanToken() protected method

protected handleSpanToken ( $token, &$str )

hashBlock() protected method

protected hashBlock ( $text )

hashHTMLBlocks() protected method

protected hashHTMLBlocks ( $text )

hashPart() protected method

protected hashPart ( $text, $boundary = 'X' )

makeCodeSpan() protected method

protected makeCodeSpan ( $code )

outdent() protected method

protected outdent ( $text )

parse() public method

提供给ThinkPHP外部调用的方法,麦当苗儿为ThinkPHP添加
Author: ([email protected])
public parse ( string $content ) : string
$content string 需要解析的Markdown字符串
return string 解析后的HTML字符串

parseSpan() protected method

protected parseSpan ( $str )

prepareItalicsAndBold() protected method

protected prepareItalicsAndBold ( )

processListItems() protected method

protected processListItems ( $list_str, $marker_any_re )

runBasicBlockGamut() protected method

protected runBasicBlockGamut ( $text )

runBlockGamut() protected method

protected runBlockGamut ( $text )

runSpanGamut() protected method

protected runSpanGamut ( $text )

setup() protected method

protected setup ( )

stripLinkDefinitions() protected method

protected stripLinkDefinitions ( $text )

teardown() protected method

protected teardown ( )

transform() protected method

protected transform ( $text )

unhash() protected method

protected unhash ( $text )

Property Details

$block_gamut protected_oe property

protected $block_gamut

$document_gamut protected_oe property

protected $document_gamut

$em_relist protected_oe property

protected $em_relist

$em_strong_prepared_relist protected_oe property

protected $em_strong_prepared_relist

$em_strong_relist protected_oe property

protected $em_strong_relist

$empty_element_suffix public_oe property

# Change to ">" for HTML output.
public $empty_element_suffix

$escape_chars protected_oe property

# Table of hash values for escaped characters:
protected $escape_chars

$escape_chars_re protected_oe property

protected $escape_chars_re

$html_hashes protected_oe property

protected $html_hashes

$in_anchor protected_oe property

# Status flag to avoid invalid nesting.
protected $in_anchor

$list_level protected_oe property

protected $list_level

$nested_brackets_depth protected_oe property

# Needed to insert a maximum bracked depth while converting to PHP.
protected $nested_brackets_depth

$nested_brackets_re protected_oe property

protected $nested_brackets_re

$nested_url_parenthesis_depth protected_oe property

protected $nested_url_parenthesis_depth

$nested_url_parenthesis_re protected_oe property

protected $nested_url_parenthesis_re

$no_entities public_oe property

public $no_entities

$no_markup public_oe property

# Change to true to disallow markup or entities.
public $no_markup

$predef_titles public_oe property

public $predef_titles

$predef_urls public_oe property

# Predefined urls and titles for reference links and images.
public $predef_urls

$span_gamut protected_oe property

protected $span_gamut

$strong_relist protected_oe property

protected $strong_relist

$tab_width public_oe property

public $tab_width

$titles protected_oe property

protected $titles

$urls protected_oe property

# Internal hashes used during transformation.
protected $urls

$utf8_strlen protected_oe property

# hanlde UTF-8 if the default function does not exist.
protected $utf8_strlen