Completed
Branch wip/litedown (e234a3)
by Josh
31:46 queued 18:30
created

ForcedLineBreaks::parse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
crap 2
1
<?php
2
3
/**
4
* @package   s9e\TextFormatter
5
* @copyright Copyright (c) 2010-2017 The s9e Authors
6
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
7
*/
8
namespace s9e\TextFormatter\Plugins\Litedown\Parser\Passes;
9
10
class ForcedLineBreaks extends AbstractPass
11
{
12
	/**
13
	* {@inheritdoc}
14
	*/
15 263
	public function parse()
16
	{
17 263
		$pos = $this->text->indexOf("  \n");
18 263
		while ($pos !== false)
19
		{
20 6
			$this->parser->addBrTag($pos + 2);
21 6
			$pos = $this->text->indexOf("  \n", $pos + 3);
22 6
		}
23
	}
24
}