disable headings in markdown (#1843)

This commit is contained in:
Kevin Papst
2020-07-26 21:06:33 +02:00
committed by GitHub
parent 6bd2390acf
commit 6f8c0e3cb6
4 changed files with 41 additions and 10 deletions

View File

@@ -16,6 +16,36 @@ class ParsedownExtension extends \Parsedown
{
private $ids = [];
/**
* Overwritten to prevent # to show up as headings for two reasons:
* - Hashes are often used to cross link issues in other systems
* - Headings should not occur in time record listings
*/
protected $BlockTypes = [
'*' => ['Rule', 'List'],
'+' => ['List'],
'-' => ['SetextHeader', 'Table', 'Rule', 'List'],
'0' => ['List'],
'1' => ['List'],
'2' => ['List'],
'3' => ['List'],
'4' => ['List'],
'5' => ['List'],
'6' => ['List'],
'7' => ['List'],
'8' => ['List'],
'9' => ['List'],
':' => ['Table'],
'<' => ['Comment', 'Markup'],
'=' => ['SetextHeader'],
'>' => ['Quote'],
'[' => ['Reference'],
'_' => ['Rule'],
'`' => ['FencedCode'],
'|' => ['Table'],
'~' => ['FencedCode'],
];
/**
* Overwritten to add support for file:///
*/