simplify names of block types

This commit is contained in:
Emanuil Rusev 2014-01-27 22:21:58 +02:00
parent bbce965a9a
commit 3d581dcaa9
1 changed files with 14 additions and 14 deletions

View File

@ -98,7 +98,7 @@ class Parsedown
switch ($block['type']) switch ($block['type'])
{ {
case 'fenced block': case 'fenced':
if ( ! isset($block['closed'])) if ( ! isset($block['closed']))
{ {
@ -121,7 +121,7 @@ class Parsedown
break; break;
case 'block-level markup': case 'markup':
if ( ! isset($block['closed'])) if ( ! isset($block['closed']))
{ {
@ -165,7 +165,7 @@ class Parsedown
switch ($block['type']) switch ($block['type'])
{ {
case 'blockquote': case 'quote':
if ( ! isset($block['interrupted'])) if ( ! isset($block['interrupted']))
{ {
@ -243,7 +243,7 @@ class Parsedown
{ {
$code_line = substr($line, 4); $code_line = substr($line, 4);
if ($block['type'] === 'code block') if ($block['type'] === 'code')
{ {
if (isset($block['interrupted'])) if (isset($block['interrupted']))
{ {
@ -259,7 +259,7 @@ class Parsedown
$blocks []= $block; $blocks []= $block;
$block = array( $block = array(
'type' => 'code block', 'type' => 'code',
'text' => $code_line, 'text' => $code_line,
); );
} }
@ -383,7 +383,7 @@ class Parsedown
} }
$block = array( $block = array(
'type' => 'block-level markup', 'type' => 'markup',
'text' => $deindented_line, 'text' => $deindented_line,
'start' => '<'.$name.'>', 'start' => '<'.$name.'>',
'end' => '</'.$name.'>', 'end' => '</'.$name.'>',
@ -409,7 +409,7 @@ class Parsedown
$blocks []= $block; $blocks []= $block;
$block = array( $block = array(
'type' => 'blockquote', 'type' => 'quote',
'lines' => array( 'lines' => array(
$matches[1], $matches[1],
), ),
@ -452,7 +452,7 @@ class Parsedown
$blocks []= $block; $blocks []= $block;
$block = array( $block = array(
'type' => 'fenced block', 'type' => 'fenced',
'text' => '', 'text' => '',
'fence' => $matches[1], 'fence' => $matches[1],
); );
@ -479,7 +479,7 @@ class Parsedown
$blocks []= $block; $blocks []= $block;
$block = array( $block = array(
'type' => 'hr', 'type' => 'rule',
); );
continue 2; continue 2;
@ -600,7 +600,7 @@ class Parsedown
break; break;
case 'blockquote': case 'quote':
$text = $this->parse_block_elements($block['lines']); $text = $this->parse_block_elements($block['lines']);
@ -608,7 +608,7 @@ class Parsedown
break; break;
case 'code block': case 'code':
$text = htmlspecialchars($block['text'], ENT_NOQUOTES, 'UTF-8'); $text = htmlspecialchars($block['text'], ENT_NOQUOTES, 'UTF-8');
@ -616,7 +616,7 @@ class Parsedown
break; break;
case 'fenced block': case 'fenced':
$text = htmlspecialchars($block['text'], ENT_NOQUOTES, 'UTF-8'); $text = htmlspecialchars($block['text'], ENT_NOQUOTES, 'UTF-8');
@ -639,7 +639,7 @@ class Parsedown
break; break;
case 'hr': case 'rule':
$markup .= '<hr />'."\n"; $markup .= '<hr />'."\n";
@ -672,7 +672,7 @@ class Parsedown
break; break;
case 'block-level markup': case 'markup':
$markup .= $block['text']."\n"; $markup .= $block['text']."\n";