Skip to content

Commit

Permalink
Merge pull request #5 from AlirezaSedghi/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirezaSedghi authored Mar 23, 2022
2 parents d95077a + 98b0437 commit 8380b38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Virastar is a Persian text cleaner.

> This repository is PHP port of [brothersincode/virastar](https://github.com/brothersincode/virastar)
see live [demo](https://alirezasedghi.com/virastar)
Official website and [Persian usage guide](https://github.alirezasedghi.com/virastar/#documents)

## Install
```bash
Expand Down
8 changes: 4 additions & 4 deletions src/Virastar.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function decodeHTMLEntities($text)
{
return preg_replace_callback('/&(#?[^;\W]+;?)/', function ($matched) {
$match = $matched[1] ?? '';
$html[] = $matched;
// $html[] = $matched;
return ' __HTML__PRESERVER__ ';
}, $text);
}
Expand All @@ -212,7 +212,7 @@ public function decodeHTMLEntities($text)
* Cleanup Text
*
* @param $text
* @return array|string|string[]|null
* @return string
* @throws Exception
*/
public function cleanup($text)
Expand Down Expand Up @@ -1016,7 +1016,7 @@ protected function flipPunctuations($text)
$sElement = $start[$iStart];
$sReg = '^\\' . $sElement . '/i';
if (preg_match($sReg, $text)) {
$text = preg_match($sReg, '', $trimmed);
$text = preg_replace($sReg, '', $trimmed);
$after[] = $sElement;
}
}
Expand All @@ -1026,7 +1026,7 @@ protected function flipPunctuations($text)
$eElement = $end[$iEnd];
$eReg = '\\' . $eElement . '$/i';
if (preg_match($eReg, $text)) {
$text = preg_match($eReg, '', $trimmed);
$text = preg_replace($eReg, '', $trimmed);
$before[] = $eElement;
}
}
Expand Down

0 comments on commit 8380b38

Please sign in to comment.