Browse Source

make context links inline

main
ghost 9 months ago
parent
commit
98c46adb21
  1. 15
      src/Dokuwiki/Reader.php

15
src/Dokuwiki/Reader.php

@ -40,25 +40,26 @@ class Reader
'/\{\{\s?([^\}]+)\s?\}\}/' => '{{$1}}', '/\{\{\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' => '$3 ( https://$1.wikipedia.org/wiki/$2 )',
'/\[\[wp>([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> https://en.wikipedia.org/wiki/$1 $2' . PHP_EOL, '/\[\[wp>([^\|]+)\|([^\]]+)\]\]/i' => '$2 ( https://en.wikipedia.org/wiki/$1 )',
/// Dokuwiki /// Dokuwiki
'/\[\[doku>([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> https://www.dokuwiki.org/$1 $2' . PHP_EOL, '/\[\[doku>([^\|]+)\|([^\]]+)\]\]/i' => '$2( https://www.dokuwiki.org/$1 )',
/// Index /// Index
'/\{\{indexmenu>:([^\}]+)\}\}/i' => PHP_EOL . '=> $1' . PHP_EOL, // @TODO '/\{\{indexmenu>:([^\}]+)\}\}/i' => '$1', // @TODO
'/\{\{indexmenu_n>[\d]+\}\}/i' => '', // @TODO '/\{\{indexmenu_n>[\d]+\}\}/i' => '', // @TODO
// Related // Related
'/\[\[this>([^\|]+)\|([^\]]+)\]\]/i' => '$2', '/\[\[this>([^\|]+)\|([^\]]+)\]\]/i' => '$2',
/// Relative /// Relative
'/\[\[(?!https?:|gemini:|this>|doku>|wp[A-z]{0,2}>)([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> /$1 $2$3' . PHP_EOL, '/\[\[(?!https?:|this|doku|wp[A-z]{0,2})([^\|]+)\|([^\]]+)\]\]/i' => ' $2$3 ( /$1 )',
'/\[\[(?!https?:|gemini:|this>|doku>|wp[A-z]{0,2}>)([^\]]+)\]\]/i' => PHP_EOL . '=> /$1 $2' . PHP_EOL, '/\[\[(?!https?:|this|doku|wp[A-z]{0,2})([^\]]+)\]\]/i' => ' $2 ( /$1 )',
/// Absolute /// Absolute
'/\[\[(https?:|gemini:)([^\|]+)\|([^\]]+)\]\]/i' => PHP_EOL . '=> $1$2 $3' . PHP_EOL, '/\[\[(https?:)([^\|]+)\|([^\]]+)\]\]/i' => '$3 ( $1$2 )',
'/\[\[(https?:)([^\]]+)\]\]/i' => '$1$2', // @TODO
// List // List
'/^[\s]?-/' => '* ', '/^[\s]?-/' => '* ',

Loading…
Cancel
Save