1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Standardise formatting

This commit is contained in:
Aidan Woods
2018-12-04 17:24:25 +01:00
parent 267256cbb8
commit 8512e65a18
11 changed files with 583 additions and 736 deletions

View File

@@ -23,10 +23,10 @@ class CommonMarkTestWeak extends CommonMarkTestStrict
parent::setUp();
$textLevelElements = $this->parsedown->getTextLevelElements();
array_walk($textLevelElements, function (&$element) {
$element = preg_quote($element, '/');
\array_walk($textLevelElements, function (&$element) {
$element = \preg_quote($element, '/');
});
$this->textLevelElementRegex = '\b(?:' . implode('|', $textLevelElements) . ')\b';
$this->textLevelElementRegex = '\b(?:' . \implode('|', $textLevelElements) . ')\b';
}
/**
@@ -50,11 +50,11 @@ class CommonMarkTestWeak extends CommonMarkTestStrict
{
// invisible whitespaces at the beginning and end of block elements
// however, whitespaces at the beginning of <pre> elements do matter
$markup = preg_replace(
array(
$markup = \preg_replace(
[
'/(<(?!(?:' . $this->textLevelElementRegex . '|\bpre\b))\w+\b[^>]*>(?:<' . $this->textLevelElementRegex . '[^>]*>)*)\s+/s',
'/\s+((?:<\/' . $this->textLevelElementRegex . '>)*<\/(?!' . $this->textLevelElementRegex . ')\w+\b>)/s'
),
],
'$1',
$markup
);