Skip to content

Commit

Permalink
Line handler may prevent specified element nesting
Browse files Browse the repository at this point in the history
Swap `under_scores` for `camelCasing`
  • Loading branch information
aidantwoods committed Oct 8, 2016
1 parent 543a6c4 commit 3aef89b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Parsedown.php
Expand Up @@ -987,7 +987,7 @@ protected function paragraph($Line)
# ~
#

public function line($text, $non_nestables=array())
public function line($text, $nonNestables=array())
{
$markup = '';

Expand All @@ -1005,7 +1005,7 @@ public function line($text, $non_nestables=array())
{
# check to see if the current inline type is nestable in the current context

if ( ! empty($non_nestables) and in_array($inlineType, $non_nestables))
if ( ! empty($nonNestables) and in_array($inlineType, $nonNestables))
{
continue;
}
Expand Down Expand Up @@ -1033,9 +1033,9 @@ public function line($text, $non_nestables=array())

# cause the new element to 'inherit' our non nestables

foreach ($non_nestables as $non_nestable)
foreach ($nonNestables as $non_nestable)
{
$Inline['element']['non_nestables'][] = $non_nestable;
$Inline['element']['nonNestables'][] = $non_nestable;
}

# the text that comes before the inline
Expand Down Expand Up @@ -1197,7 +1197,7 @@ protected function inlineLink($Excerpt)
$Element = array(
'name' => 'a',
'handler' => 'line',
'non_nestables' => array('Url', 'Link'),
'nonNestables' => array('Url', 'Link'),
'text' => null,
'attributes' => array(
'href' => null,
Expand Down Expand Up @@ -1425,14 +1425,14 @@ protected function element(array $Element)
{
$markup .= '>';

if (!isset($Element['non_nestables']))
if (!isset($Element['nonNestables']))
{
$Element['non_nestables'] = array();
$Element['nonNestables'] = array();
}

if (isset($Element['handler']))
{
$markup .= $this->{$Element['handler']}($Element['text'], $Element['non_nestables']);
$markup .= $this->{$Element['handler']}($Element['text'], $Element['nonNestables']);
}
else
{
Expand Down

0 comments on commit 3aef89b

Please sign in to comment.