changeset 478:926f61977175

Add experimental search keyword link like hash-tags
author HIROSE Yuuji <yuuji@gentei.org>
date Sat, 02 Dec 2017 08:25:38 +0900
parents cd78711626b9
children 077dc1763239
files s4-funcs.sh
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/s4-funcs.sh	Sun Sep 24 20:18:16 2017 +0859
+++ b/s4-funcs.sh	Sat Dec 02 08:25:38 2017 +0900
@@ -459,6 +459,8 @@
   # s4 specific notation:
   #   ^href=URL
   #   ^iframe=URL
+  #   [[#NUM]]		- Jump to article ID NUM
+  #   [[#Keyword]	- Jump to keywrod search for "Keyword"
   # OSM umap Wikistyle Notation:
   #   [[URL]]		- Simle Link
   #   [[URL|Word]]	- Link with anchor word
@@ -467,7 +469,9 @@
   #   {{{URL}}	}	- <iframe src="URL"></iframe>
   #   {{{URL|height}}	- <iframe src="URL" height="height"></iframe>
   _hrefptn="[-A-Za-z0-9,.:;/~_%#&+?=@!]*"
+  _hrefptn="[^][()<>]*"
   sed -e "s|\[\[\#\([0-9][0-9]*\)\]\]|<a href=\"?aid\1\">#\1</a>|g" \
+      -e "s|\[\[\#\([^]]*\)\]\]|<a href=\"?kwd=\1\&stage=searchart\">\#\1</a>|g" \
       -e "s|\[\[\($_hrefptn\)\|\([^]]*\)\]\]|<a href=\"\1\">\2</a>|g" \
       -e "s|\[\[\($_hrefptn\)\]\]|<a href=\"\1\">\1</a>|" \
       -e "s|{{{\($_hrefptn\)\|\(.*\)}}}|<iframe src=\"\1\" height=\"\2\"></iframe>|g" \

yatex.org