1
0
mirror of https://github.com/erusev/parsedown.git synced 2025-10-04 02:11:52 +02:00
Files
php-parsedown/src/Parsing/Context.php
Aidan Woods f47ba7aa34 Track whitespace left on blank lines to match CommonMark
Test changes copy pasted to match CommonMark reference parser
2019-04-07 16:38:10 +01:00

45 lines
903 B
PHP

<?php
namespace Erusev\Parsedown\Parsing;
final class Context
{
/** @var Line */
private $Line;
/** @var int */
private $previousEmptyLines;
/** @var string */
private $previousEmptyLinesText;
/**
* @param Line $Line
* @param string $previousEmptyLinesText
*/
public function __construct($Line, $previousEmptyLinesText)
{
$this->Line = $Line;
$this->previousEmptyLinesText = $previousEmptyLinesText;
$this->previousEmptyLines = \substr_count($previousEmptyLinesText, "\n");
}
/** @return Line */
public function line()
{
return $this->Line;
}
/** @return int */
public function previousEmptyLines()
{
return $this->previousEmptyLines;
}
/** @return string */
public function previousEmptyLinesText()
{
return $this->previousEmptyLinesText;
}
}