修訂 | 1a7474701c441774106ed5788bed3fd96a203465 (tree) |
---|---|
時間 | 2020-02-09 09:21:33 |
作者 | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2499 Set Heading anchor text "user-select:none;"
@@ -993,7 +993,7 @@ class Body extends Element | ||
993 | 993 | $id = & $autoid; |
994 | 994 | $anchor = ''; |
995 | 995 | } else { |
996 | - $anchor = ' &aname(' . $id . ',super,full){' . $_symbol_anchor . '};'; | |
996 | + $anchor = ' &aname(' . $id . ',super,full,nouserselect){' . $_symbol_anchor . '};'; | |
997 | 997 | } |
998 | 998 | |
999 | 999 | $text = ' ' . $text; |
@@ -1,8 +1,8 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: aname.inc.php,v 1.28 2011/01/25 15:01:01 henoheno Exp $ | |
4 | -// Copyright (C) | |
5 | -// 2002-2005 PukiWiki Developers Team | |
3 | +// aname.inc.php | |
4 | +// Copyright | |
5 | +// 2002-2020 PukiWiki Development Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -33,7 +33,7 @@ function plugin_aname_usage($convert = TRUE, $message = '') | ||
33 | 33 | } |
34 | 34 | } else { |
35 | 35 | if ($message == '') { |
36 | - return '&aname(anchorID[,super][,full][,noid]){[Link title]};'; | |
36 | + return '&aname(anchorID[,super][,full][,noid][,nouserselect]){[Link title]};'; | |
37 | 37 | } else { |
38 | 38 | return '&aname: ' . $message . ';'; |
39 | 39 | } |
@@ -80,6 +80,7 @@ function plugin_aname_tag($args = array(), $convert = TRUE) | ||
80 | 80 | $f_noid = in_array('noid', $args); // Option: Without id attribute |
81 | 81 | $f_super = in_array('super', $args); // Option: CSS class |
82 | 82 | $f_full = in_array('full', $args); // Option: With full(absolute) URI |
83 | + $f_nouserselect = in_array('nouserselect', $args); // Option: user-select:none; | |
83 | 84 | |
84 | 85 | if ($body == '') { |
85 | 86 | if ($f_noid) return plugin_aname_usage($convert, 'Meaningless(No link-title with \'noid\')'); |
@@ -103,14 +104,17 @@ function plugin_aname_tag($args = array(), $convert = TRUE) | ||
103 | 104 | $class = $f_super ? 'anchor_super' : 'anchor'; |
104 | 105 | $attr_id = $f_noid ? '' : ' id="' . $id . '"'; |
105 | 106 | $url = $f_full ? get_page_uri($vars['page']) : ''; |
107 | + $astyle = ''; | |
106 | 108 | if ($body != '') { |
107 | 109 | $href = ' href="' . $url . '#' . $id . '"'; |
108 | 110 | $title = ' title="' . $id . '"'; |
111 | + if ($f_nouserselect) { | |
112 | + $astyle = ' style="user-select:none;"'; | |
113 | + } | |
109 | 114 | } else { |
110 | 115 | $href = $title = ''; |
111 | 116 | } |
112 | - | |
113 | - return '<a class="' . $class . '"' . $attr_id . $href . $title . '>' . | |
117 | + return '<a class="' . $class . '"' . $attr_id . $href . $title . | |
118 | + $astyle . '>' . | |
114 | 119 | $body . '</a>'; |
115 | 120 | } |
116 | - |