Skip to content

Commit

Permalink
Fixed cfgSetAutoPregReplace
Browse files Browse the repository at this point in the history
I don't know why the order of parsing was changed, but now it is correct
  • Loading branch information
bezumkin authored Mar 21, 2019
1 parent bb4b883 commit 663530f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Jevix.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,14 +764,6 @@ public function parse($text, &$errors)
}
}

if (!empty($this->autoReplace)) {
$this->text = str_ireplace($this->autoReplace['from'], $this->autoReplace['to'], $this->text);
}

if (!empty($replacements)) {
$this->text = str_replace(array_keys($replacements), $replacements, $this->text);
}

// Авто растановка BR?
if ($this->isAutoBrMode) {
$this->text = preg_replace('/<br\/?>(\r\n|\n\r|\n)?/ui', $this->nl, $this->text);
Expand All @@ -789,6 +781,14 @@ public function parse($text, &$errors)
$this->skipSpaces();
$this->anyThing($content);
$errors = $this->errors;

if (!empty($this->autoReplace)){
$content = str_ireplace($this->autoReplace['from'], $this->autoReplace['to'], $content);
}

if (!empty($replacements)) {
$content = str_replace(array_keys($replacements), $replacements, $content);
}

return $content;
}
Expand Down

0 comments on commit 663530f

Please sign in to comment.