@@ -30,9 +30,9 @@ public function __construct()
3030 $ environment ->addExtension (new GithubFlavoredMarkdownExtension ());
3131 $ environment ->addExtension (new TaskListExtension ());
3232
33- //$environment->addExtension(new PhikiExtension(Theme::GithubLight));
33+ // $environment->addExtension(new PhikiExtension(Theme::GithubLight));
3434
35- $ highlighter = new Highlighter (new InlineTheme (__DIR__ . '/../assets/hightlight.css ' ));
35+ $ highlighter = new Highlighter (new InlineTheme (__DIR__ . '/../assets/hightlight.css ' ));
3636 $ environment ->addExtension (new HighlightExtension ($ highlighter ));
3737
3838 /*
@@ -62,8 +62,7 @@ public function convert(string $markdown, int $index): string
6262 'Trademark ' ,
6363 ]);
6464
65- $ fixer ->setLocale ("ru " );
66-
65+ $ fixer ->setLocale ('ru ' );
6766
6867 $ crawler = new Crawler ($ html );
6968
@@ -81,10 +80,9 @@ public function convert(string $markdown, int $index): string
8180 $ html = $ t ->apply ($ html );
8281 });
8382
84-
8583 $ crawler
8684 ->filter ('p,li ' )
87- ->each (function (Crawler $ elm ) use ($ fixer , &$ html ) {
85+ ->each (function (Crawler $ elm ) use (&$ html ) {
8886
8987 $ content = $ elm ->html ();
9088
@@ -93,8 +91,6 @@ public function convert(string $markdown, int $index): string
9391 $ html = Str::of ($ html )->replace ($ content , $ paragraph );
9492 });
9593
96-
97-
9894 $ syllable = new Syllable ('ru ' );
9995 $ syllable ->setCache (null );
10096 $ syllable ->setMinWordLength (2 );
@@ -107,11 +103,12 @@ public function convert(string $markdown, int $index): string
107103
108104 }
109105
110- protected function preventShortWordOrphans (string $ text , int $ maxLength = 2 ): string {
106+ protected function preventShortWordOrphans (string $ text , int $ maxLength = 2 ): string
107+ {
111108 // Регулярка ищет слова длиной <= maxLength перед пробелом или переносом строки
112109 // \b — граница слова, \w{1,maxLength} — слово длиной 1 до maxLength букв
113110 // \s+ — пробелы после слова
114- $ pattern = '/\b(\w{1, ' . $ maxLength . '})\s+/u ' ;
111+ $ pattern = '/\b(\w{1, ' . $ maxLength. '})\s+/u ' ;
115112
116113 // Заменяем пробелы на неразрывный пробел
117114 $ replacement = '$1 ' ;
0 commit comments