simplify content types

This commit is contained in:
Emanuil Rusev 2014-02-24 00:55:34 +02:00
parent 0985c2ef29
commit 4f851205a7

View File

@ -187,7 +187,7 @@ class Parsedown
$nested_block = array( $nested_block = array(
'name' => 'li', 'name' => 'li',
'content type' => 'markdown lines', 'content type' => 'lines',
'content' => array( 'content' => array(
$matches[1], $matches[1],
), ),
@ -317,7 +317,7 @@ class Parsedown
$nested_block = array( $nested_block = array(
'name' => 'td', 'name' => 'td',
'content type' => 'markdown', 'content type' => 'line',
'content' => $substring, 'content' => $substring,
); );
@ -417,7 +417,7 @@ class Parsedown
$nested_block = array( $nested_block = array(
'name' => 'th', 'name' => 'th',
'content type' => 'markdown', 'content type' => 'line',
'content' => $substring, 'content' => $substring,
); );
@ -494,7 +494,7 @@ class Parsedown
'content' => array( 'content' => array(
array( array(
'name' => 'code', 'name' => 'code',
'content type' => 'markup', 'content type' => null,
'content' => $string, 'content' => $string,
), ),
), ),
@ -525,7 +525,7 @@ class Parsedown
$block = array( $block = array(
'name' => 'h'.$level, 'name' => 'h'.$level,
'content type' => 'markdown', 'content type' => 'line',
'content' => $string, 'content' => $string,
); );
@ -587,7 +587,7 @@ class Parsedown
$block = array( $block = array(
'name' => null, 'name' => null,
'content type' => 'markup', 'content type' => null,
'content' => $indented_line, 'content' => $indented_line,
); );
@ -623,7 +623,7 @@ class Parsedown
$block = array( $block = array(
'name' => 'blockquote', 'name' => 'blockquote',
'content type' => 'markdown lines', 'content type' => 'lines',
'content' => array( 'content' => array(
$matches[1], $matches[1],
), ),
@ -724,7 +724,7 @@ class Parsedown
'content' => array( 'content' => array(
array( array(
'name' => 'code', 'name' => 'code',
'content type' => 'markup', 'content type' => null,
'content' => '', 'content' => '',
), ),
), ),
@ -783,7 +783,7 @@ class Parsedown
$nested_block = array( $nested_block = array(
'name' => 'li', 'name' => 'li',
'content type' => 'markdown lines', 'content type' => 'lines',
'content' => array( 'content' => array(
$matches[2], $matches[2],
), ),
@ -820,7 +820,7 @@ class Parsedown
$block = array( $block = array(
'name' => 'p', 'name' => 'p',
'content type' => 'markdown', 'content type' => 'line',
'content' => $line, 'content' => $line,
); );
@ -879,19 +879,19 @@ class Parsedown
switch ($block['content type']) switch ($block['content type'])
{ {
case 'markup': case null:
$markup .= $block['content']; $markup .= $block['content'];
break; break;
case 'markdown': case 'line':
$markup .= $this->parse_span_elements($block['content']); $markup .= $this->parse_span_elements($block['content']);
break; break;
case 'markdown lines': case 'lines':
$result = $this->find_blocks($block['content'], $block['name']); $result = $this->find_blocks($block['content'], $block['name']);