CustomParsedown::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
2
3
require_once APPPATH . '../vendor/erusev/parsedown/Parsedown.php';
4
class CustomParsedown extends Parsedown {
5 96
	public function __construct() {
6 96
		$this->setSafeMode(TRUE);
7 96
	}
8
9
	protected function inlineLink($excerpt) {
10
		$link = parent::inlineLink($excerpt);
11
12
		if(!isset($link)) {
13
			return null;
14
		}
15
16
		//Make title attribute the same as link
17
		$link['element']['attributes']['title'] = $link['element']['attributes']['href'];
18
19
		return $link;
20
	}
21
}
22