aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorBattleMage <battlemage@reapers.de>2020-02-27 11:44:51 +0100
committerDominik Grothaus <dominik.grothaus@r-mails.de>2020-02-28 10:31:07 +0100
commitc74c41c3b88669802c96c565f04b2682a54d43e9 (patch)
tree412aa3e1fab3ed4ad62c55235418691d5945d932 /Zotlabs
parent7cf73e0533a61270c9bc5036c3da0e4ea4c593c5 (diff)
downloadvolse-hubzilla-c74c41c3b88669802c96c565f04b2682a54d43e9.tar.gz
volse-hubzilla-c74c41c3b88669802c96c565f04b2682a54d43e9.tar.bz2
volse-hubzilla-c74c41c3b88669802c96c565f04b2682a54d43e9.zip
Allow wiki link titles
Allow linking to wiki pages with alternating titles by separating the title from the link with a pipe, like regular wiki markup does.
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/NativeWikiPage.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php
index dddd26af3..d84cc50a8 100644
--- a/Zotlabs/Lib/NativeWikiPage.php
+++ b/Zotlabs/Lib/NativeWikiPage.php
@@ -530,8 +530,11 @@ class NativeWikiPage {
foreach ($match[1] as $m) {
// TODO: Why do we need to double urlencode for this to work?
//$pageURLs[] = urlencode(urlencode(escape_tags($m)));
- $pageURLs[] = Zlib\NativeWiki::name_encode(escape_tags($m));
- $pages[] = $m;
+ $titleUri = explode('|',$m);
+ $page = $titleUri[0] ?? '';
+ $title = $titleUri[1] ?? $page;
+ $pageURLs[] = Zlib\NativeWiki::name_encode(escape_tags($page));
+ $pages[] = $title;
}
$idx = 0;
while(strpos($s,'[[') !== false) {