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
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
8 changed files with 9 additions and 9 deletions

View File

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

View File

@ -80,7 +80,7 @@ final class Emphasis implements Inline
return new Element(
$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(
'a',
$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(
'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
* @return StateRenderable[]
*/
public function lineElements($text)
public function line($text)
{
# standardize line breaks
$text = \str_replace(["\r\n", "\r"], "\n", $text);