Open animaux opened 6 months ago
Question: You are talking about slashes not dashes, right?
Sorry, yes of course slashes!
BTW The zero-with space in the above code has zero with and is thus not visible :D
This is how it's implemented right now in our internal dev version:
<?php
namespace Hananils\Corrections;
use Hananils\Correction;
class Slashes extends Correction
{
public $replacements = [
'/(\p{L})\/(\p{L})/uim' => '$1/​$2'
];
public function apply()
{
$this->inspector
->toTexts()
->filterBy('categories', 'excludes', ['preformatted'])
->replaceTextAll($this->replacements, isRegEx: true);
}
}