Completed
Push — master ( 2bd0a4...b5b0a5 )
by Angus
07:46
created

CustomParsedown::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
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
	public function __construct() {
6
		$this->setSafeMode(TRUE);
7
	}
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