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

Make use of line name instead of lineElements

This commit is contained in:
Aidan Woods
2019-01-21 18:44:19 +00:00
parent bb8a16ad81
commit c9388cb5c2
8 changed files with 9 additions and 9 deletions

View File

@ -76,7 +76,7 @@ final class Header implements Block
return new Element( return new Element(
'h' . \strval($this->level), 'h' . \strval($this->level),
[], [],
$State->applyTo($Parsedown->lineElements($this->text)) $State->applyTo($Parsedown->line($this->text))
); );
} }
); );

View File

@ -70,7 +70,7 @@ final class Paragraph implements ContinuableBlock
return new Element( return new Element(
'p', 'p',
[], [],
$State->applyTo($Parsedown->lineElements($this->text)) $State->applyTo($Parsedown->line($this->text))
); );
} }
); );

View File

@ -66,7 +66,7 @@ final class SetextHeader implements Block
return new Element( return new Element(
'h' . \strval($this->level), 'h' . \strval($this->level),
[], [],
$State->applyTo($Parsedown->lineElements($this->text)) $State->applyTo($Parsedown->line($this->text))
); );
} }
); );

View File

@ -181,7 +181,7 @@ final class Table implements ContinuableBlock
return new Element( return new Element(
'th', 'th',
isset($alignment) ? ['style' => "text-align: $alignment;"] : [], isset($alignment) ? ['style' => "text-align: $alignment;"] : [],
$State->applyTo($Parsedown->lineElements($cell)) $State->applyTo($Parsedown->line($cell))
); );
}, },
$this->headerCells, $this->headerCells,
@ -203,7 +203,7 @@ final class Table implements ContinuableBlock
return new Element( return new Element(
'td', 'td',
isset($alignment) ? ['style' => "text-align: $alignment;"] : [], isset($alignment) ? ['style' => "text-align: $alignment;"] : [],
$State->applyTo($Parsedown->lineElements($cell)) $State->applyTo($Parsedown->line($cell))
); );
}, },
$cells, $cells,

View File

@ -80,7 +80,7 @@ final class Emphasis implements Inline
return new Element( return new Element(
$this->type, $this->type,
[], [],
$State->applyTo($Parsedown->lineElements($this->text)) $State->applyTo($Parsedown->line($this->text))
); );
} }
); );

View File

@ -129,7 +129,7 @@ final class Link implements Inline
return new Element( return new Element(
'a', 'a',
$attributes, $attributes,
$State->applyTo($Parsedown->lineElements($this->label)) $State->applyTo($Parsedown->line($this->label))
); );
} }
); );

View File

@ -59,7 +59,7 @@ final class Strikethrough implements Inline
return new Element( return new Element(
'del', 'del',
[], [],
$State->applyTo($Parsedown->lineElements($this->text)) $State->applyTo($Parsedown->line($this->text))
); );
} }
); );

View File

@ -248,7 +248,7 @@ final class Parsedown
* @param string $text * @param string $text
* @return StateRenderable[] * @return StateRenderable[]
*/ */
public function lineElements($text) public function line($text)
{ {
# standardize line breaks # standardize line breaks
$text = \str_replace(["\r\n", "\r"], "\n", $text); $text = \str_replace(["\r\n", "\r"], "\n", $text);