mirror of
https://github.com/YGGverse/gemini-php.git
synced 2025-01-29 16:24:13 +00:00
add IPv6 links support
This commit is contained in:
parent
f3ede125f2
commit
65e722d78a
@ -32,6 +32,9 @@ class Reader
|
|||||||
|
|
||||||
// Links
|
// Links
|
||||||
|
|
||||||
|
/// Detect IPv6 (used as no idea how to resolve square quotes in rules below)
|
||||||
|
'/\[\[([^\[]+)\[([A-f:0-9]*)\]([^\]]+)\]\]/' => '$1~IPv6:open~$2~IPv6:close~$3',
|
||||||
|
|
||||||
/// Remove extra spaces
|
/// Remove extra spaces
|
||||||
'/\[\[\s?([^\|]+)\s?\|\s?([^\]]+)\s?\]\]/' => '[[$1|$2]]',
|
'/\[\[\s?([^\|]+)\s?\|\s?([^\]]+)\s?\]\]/' => '[[$1|$2]]',
|
||||||
'/\[\[\s?([^\]]+)\s?\]\]/' => '[[$1]]',
|
'/\[\[\s?([^\]]+)\s?\]\]/' => '[[$1]]',
|
||||||
@ -64,6 +67,10 @@ class Reader
|
|||||||
'/\[\[(https?:)([^\|]+)\|([^\]]+)\]\]/i' => '$3 ( $1$2 )',
|
'/\[\[(https?:)([^\|]+)\|([^\]]+)\]\]/i' => '$3 ( $1$2 )',
|
||||||
'/\[\[(https?:)([^\]]+)\]\]/i' => '$1$2', // @TODO
|
'/\[\[(https?:)([^\]]+)\]\]/i' => '$1$2', // @TODO
|
||||||
|
|
||||||
|
/// Apply macros
|
||||||
|
'/~IPv6:open~/' => '[',
|
||||||
|
'/~IPv6:close~/' => ']',
|
||||||
|
|
||||||
// List
|
// List
|
||||||
'/^[\s]?-/' => '* ',
|
'/^[\s]?-/' => '* ',
|
||||||
'/^[\s]+\*/' => '*',
|
'/^[\s]+\*/' => '*',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user