mirror of
https://github.com/YGGverse/gemini-php.git
synced 2026-03-31 17:05:29 +00:00
add extra space filter
This commit is contained in:
parent
445ff8fcfa
commit
b889410502
1 changed files with 10 additions and 3 deletions
|
|
@ -32,6 +32,13 @@ class Reader
|
||||||
|
|
||||||
// Links
|
// Links
|
||||||
|
|
||||||
|
/// Remove extra spaces
|
||||||
|
'/\[\[\s?([^\|]+)\s?\|\s?([^\]]+)\s?\]\]/' => '[[$1|$2]]',
|
||||||
|
'/\[\[\s?([^\]]+)\s?\]\]/' => '[[$1]]',
|
||||||
|
|
||||||
|
'/\{\{\s?([^\|]+)\s?\|\s?([^\}]+)\s?\}\}/' => '{{$1|$2}}',
|
||||||
|
'/\{\{\s?([^\}]+)\s?\}\}/' => '{{$1}}',
|
||||||
|
|
||||||
/// Wikipedia
|
/// Wikipedia
|
||||||
'/\[\[wp([A-z]{2,})>([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> https://$1.wikipedia.org/wiki/$2 $3' . PHP_EOL,
|
'/\[\[wp([A-z]{2,})>([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> https://$1.wikipedia.org/wiki/$2 $3' . PHP_EOL,
|
||||||
'/\[\[wp>([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> https://en.wikipedia.org/wiki/$1 $2' . PHP_EOL,
|
'/\[\[wp>([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> https://en.wikipedia.org/wiki/$1 $2' . PHP_EOL,
|
||||||
|
|
@ -43,13 +50,13 @@ class Reader
|
||||||
'/\{\{indexmenu>:([^\}]+)\}\}/i' => PHP_EOL . '=> $1' . PHP_EOL, // @TODO
|
'/\{\{indexmenu>:([^\}]+)\}\}/i' => PHP_EOL . '=> $1' . PHP_EOL, // @TODO
|
||||||
'/\{\{indexmenu_n>[\d]+\}\}/i' => '', // @TODO
|
'/\{\{indexmenu_n>[\d]+\}\}/i' => '', // @TODO
|
||||||
|
|
||||||
|
// Related
|
||||||
|
'/\[\[this>([^\|]+)\|([^\]]+)\]\]/i' => '$2',
|
||||||
|
|
||||||
/// Relative
|
/// Relative
|
||||||
'/\[\[(?!https?:|gemini:|this>|doku>|wp[A-z]{0,2}>)([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> /$1 $2$3' . PHP_EOL,
|
'/\[\[(?!https?:|gemini:|this>|doku>|wp[A-z]{0,2}>)([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> /$1 $2$3' . PHP_EOL,
|
||||||
'/\[\[(?!https?:|gemini:|this>|doku>|wp[A-z]{0,2}>)([^\]]+)\]\]/i' => PHP_EOL . '=> /$1 $2' . PHP_EOL,
|
'/\[\[(?!https?:|gemini:|this>|doku>|wp[A-z]{0,2}>)([^\]]+)\]\]/i' => PHP_EOL . '=> /$1 $2' . PHP_EOL,
|
||||||
|
|
||||||
// Related
|
|
||||||
'/\[\[this>([^\|]+)\|([^\]]+)\]\]/i' => '$2',
|
|
||||||
|
|
||||||
/// Absolute
|
/// Absolute
|
||||||
'/\[\[(https?:|gemini:)([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> $1$2 $3' . PHP_EOL,
|
'/\[\[(https?:|gemini:)([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> $1$2 $3' . PHP_EOL,
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue