1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

improve naming consistency

This commit is contained in:
Emanuil Rusev 2014-05-03 18:02:06 +03:00
parent cc94c1b584
commit 0c9a4af8ab

View File

@ -49,7 +49,7 @@ class Parsedown
$markup = trim($markup, "\n"); $markup = trim($markup, "\n");
# clean up # clean up
$this->definitions = array(); $this->Text = array();
return $markup; return $markup;
} }
@ -71,7 +71,7 @@ class Parsedown
# Blocks # Blocks
# #
protected $blockMarkers = array( protected $Block = array(
'#' => array('Atx'), '#' => array('Atx'),
'*' => array('Rule', 'List'), '*' => array('Rule', 'List'),
'+' => array('List'), '+' => array('List'),
@ -97,7 +97,7 @@ class Parsedown
'~' => array('FencedCode'), '~' => array('FencedCode'),
); );
protected $definitionMarkers = array( protected $Definition = array(
'[' => array('Reference'), '[' => array('Reference'),
); );
@ -163,15 +163,15 @@ class Parsedown
# Definitions # Definitions
if (isset($this->definitionMarkers[$marker])) if (isset($this->Definition[$marker]))
{ {
foreach ($this->definitionMarkers[$marker] as $definitionType) foreach ($this->Definition[$marker] as $definitionType)
{ {
$Definition = $this->{'identify'.$definitionType}($Line, $CurrentBlock); $Definition = $this->{'identify'.$definitionType}($Line, $CurrentBlock);
if (isset($Definition)) if (isset($Definition))
{ {
$this->definitions[$definitionType][$Definition['id']] = $Definition['data']; $this->Text[$definitionType][$Definition['id']] = $Definition['data'];
continue 2; continue 2;
} }
@ -182,9 +182,9 @@ class Parsedown
$blockTypes = $this->unmarkedBlockTypes; $blockTypes = $this->unmarkedBlockTypes;
if (isset($this->blockMarkers[$marker])) if (isset($this->Block[$marker]))
{ {
foreach ($this->blockMarkers[$marker] as $blockType) foreach ($this->Block[$marker] as $blockType)
{ {
$blockTypes []= $blockType; $blockTypes []= $blockType;
} }
@ -892,7 +892,7 @@ class Parsedown
# Spans # Spans
# #
protected $spanMarkers = array( protected $Span = array(
'!' => array('Link'), # ? '!' => array('Link'), # ?
'&' => array('Ampersand'), '&' => array('Ampersand'),
'*' => array('Emphasis'), '*' => array('Emphasis'),
@ -921,7 +921,7 @@ class Parsedown
$markerPosition += strpos($remainder, $marker); $markerPosition += strpos($remainder, $marker);
foreach ($this->spanMarkers[$marker] as $spanType) foreach ($this->Span[$marker] as $spanType)
{ {
$handler = 'identify'.$spanType; $handler = 'identify'.$spanType;
@ -1132,9 +1132,9 @@ class Parsedown
{ {
$Link['label'] = strtolower($matches[1]); $Link['label'] = strtolower($matches[1]);
if (isset($this->definitions['Reference'][$Link['label']])) if (isset($this->Text['Reference'][$Link['label']]))
{ {
$Link += $this->definitions['Reference'][$Link['label']]; $Link += $this->Text['Reference'][$Link['label']];
$extent += strlen($matches[0]); $extent += strlen($matches[0]);
} }
@ -1143,9 +1143,9 @@ class Parsedown
return; return;
} }
} }
elseif (isset($this->definitions['Reference'][$Link['label']])) elseif (isset($this->Text['Reference'][$Link['label']]))
{ {
$Link += $this->definitions['Reference'][$Link['label']]; $Link += $this->Text['Reference'][$Link['label']];
if (preg_match('/^[ ]*\[\]/', $substring, $matches)) if (preg_match('/^[ ]*\[\]/', $substring, $matches))
{ {
@ -1313,7 +1313,7 @@ class Parsedown
# Fields # Fields
# #
protected $definitions; protected $Text;
# #
# Read-only # Read-only