Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 16, 2025
1 parent a441883 commit a6ef41c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Texy/Modules/BlockModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(Texy\Texy $texy)

$texy->registerBlockPattern(
$this->pattern(...),
'#^/--++ *+(.*)' . Texy\Patterns::MODIFIER_H . '?$((?:\n(?0)|\n.*+)*)(?:\n\\\\--.*$|\z)#mUi',
'#^/--++ *+(.*)' . Texy\Patterns::MODIFIER_H . '?$((?:\n(?0)|\n.*+)*)(?:\n\\\--.*$|\z)#mUi',
'blocks',
);
}
Expand All @@ -52,7 +52,7 @@ private function beforeBlockParse(Texy\BlockParser $parser, string &$text): void
// autoclose exclusive blocks
$text = Texy\Regexp::replace(
$text,
'#^(/--++ *+(?!div|texysource).*)$((?:\n.*+)*?)(?:\n\\\\--.*$|(?=(\n/--.*$)))#mi',
'#^(/--++ *+(?!div|texysource).*)$((?:\n.*+)*?)(?:\n\\\--.*$|(?=(\n/--.*$)))#mi',
"\$1\$2\n\\--",
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Texy/Modules/LinkModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function factoryLink(string $dest, ?string $mMod, ?string $label): Link
$dest = substr($dest, 1, -1);
$link = $this->getReference($dest);

// [* image *]
// [* image *]
} elseif (strlen($dest) > 1 && $dest[0] === '[' && $dest[1] === '*') {
$type = Link::IMAGE;
$dest = trim(substr($dest, 2, -2));
Expand Down
2 changes: 1 addition & 1 deletion src/Texy/Modules/ParagraphModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private function solve(
$el->setName($texy->nontextParagraph);
}

// block contains only markup tags or spaces or nothing
// block contains only markup tags or spaces or nothing
} else {
// if {ignoreEmptyStuff} return null;
if (!$mod) {
Expand Down
8 changes: 4 additions & 4 deletions src/Texy/Modules/PhraseModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ public function __construct(Texy\Texy $texy)
// ***strong+emphasis***
$texy->registerLinePattern(
$this->patternPhrase(...),
'#(?<![*\\\\])\*\*\*(?![\s*])((?:[^ *]++|[ *])+)' . Patterns::MODIFIER . '?(?<![\s*\\\\])\*\*\*(?!\*)(?::(' . Patterns::LINK_URL . '))??()#Uus',
'#(?<![*\\\])\*\*\*(?![\s*])((?:[^ *]++|[ *])+)' . Patterns::MODIFIER . '?(?<![\s*\\\])\*\*\*(?!\*)(?::(' . Patterns::LINK_URL . '))??()#Uus',
'phrase/strong+em',
);

// **strong**
$texy->registerLinePattern(
$this->patternPhrase(...),
'#(?<![*\\\\])\*\*(?![\s*])((?:[^ *]++|[ *])+)' . Patterns::MODIFIER . '?(?<![\s*\\\\])\*\*(?!\*)(?::(' . Patterns::LINK_URL . '))??()#Uus',
'#(?<![*\\\])\*\*(?![\s*])((?:[^ *]++|[ *])+)' . Patterns::MODIFIER . '?(?<![\s*\\\])\*\*(?!\*)(?::(' . Patterns::LINK_URL . '))??()#Uus',
'phrase/strong',
);

Expand All @@ -82,14 +82,14 @@ public function __construct(Texy\Texy $texy)
// *emphasisAlt*
$texy->registerLinePattern(
$this->patternPhrase(...),
'#(?<![*\\\\])\*(?![\s*])((?:[^\s*]++|[*])+)' . Patterns::MODIFIER . '?(?<![\s*\\\\])\*(?!\*)(?::(' . Patterns::LINK_URL . '))??()#Uus',
'#(?<![*\\\])\*(?![\s*])((?:[^\s*]++|[*])+)' . Patterns::MODIFIER . '?(?<![\s*\\\])\*(?!\*)(?::(' . Patterns::LINK_URL . '))??()#Uus',
'phrase/em-alt',
);

// *emphasisAlt2*
$texy->registerLinePattern(
$this->patternPhrase(...),
'#(?<![^\s.,;:<>()"\'' . Patterns::MARK . '-])\*(?![\s*])((?:[^ *]++|[ *])+)' . Patterns::MODIFIER . '?(?<![\s*\\\\])\*(?![^\s.,;:<>()"?!\'-])(?::(' . Patterns::LINK_URL . '))??()#Uus',
'#(?<![^\s.,;:<>()"\'' . Patterns::MARK . '-])\*(?![\s*])((?:[^ *]++|[ *])+)' . Patterns::MODIFIER . '?(?<![\s*\\\])\*(?![^\s.,;:<>()"?!\'-])(?::(' . Patterns::LINK_URL . '))??()#Uus',
'phrase/em-alt2',
);

Expand Down
2 changes: 1 addition & 1 deletion src/Texy/Modules/TypographyModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ final class TypographyModule extends Texy\Module
private static array $patterns = [
'#(?<![.\x{2026}])\.{3,4}(?![.\x{2026}])#mu' => "\u{2026}", // ellipsis ...
'#(?<=[\d ]|^)-(?=[\d ]|$)#' /*. */ => "\u{2013}", // en dash 123-123
'#(?<=[^!*+,/:;<=>@\\\\_|-])--(?=[^!*+,/:;<=>@\\\\_|-])#' => "\u{2013}", // en dash alphanum--alphanum
'#(?<=[^!*+,/:;<=>@\\\_|-])--(?=[^!*+,/:;<=>@\\\_|-])#' => "\u{2013}", // en dash alphanum--alphanum
'#,-#' /*. */ => ",\u{2013}", // en dash ,-
'#(?<!\d)(\d{1,2}\.) (\d{1,2}\.) (\d\d)#' => "\$1\u{A0}\$2\u{A0}\$3", // date 23. 1. 1978
'#(?<!\d)(\d{1,2}\.) (\d{1,2}\.)#' /*. */ => "\$1\u{A0}\$2", // date 23. 1.
Expand Down

0 comments on commit a6ef41c

Please sign in to comment.