@@ -967,8 +967,17 @@ function module_code(library_namespace) {
967967 }
968968 }
969969
970- // 可算 function preprocess_section_link_token(token, options) 的簡化版。
971- // 可能保留 "\n"、不可見字符 必須自己 .trim()。
970+ /**
971+ * 將 wiki element 轉成 key。
972+ *
973+ * 可算 function preprocess_section_link_token(token, options) 的簡化版。
974+ *
975+ * 可能保留 "\n"、不可見字符 必須自己 .trim()。
976+ *
977+ * @param {Array|String }token
978+ * wiki element token
979+ * @returns {String|Array } key
980+ */
972981 function wiki_element_to_key ( token ) {
973982 if ( ! Array . isArray ( token ) )
974983 return token ;
@@ -994,6 +1003,7 @@ function module_code(library_namespace) {
9941003 // console.trace([ has_no_string, _token ]);
9951004 if ( token . type === 'plain' && ! has_no_string )
9961005 return _token . join ( '' ) ;
1006+ // 注意: 這時 不會回傳 {String}!
9971007 return set_wiki_type ( _token , token . type ) ;
9981008 }
9991009
@@ -2660,11 +2670,11 @@ function module_code(library_namespace) {
26602670 invoke_properties . module_name
26612671 // token[1]: module name 模組名稱
26622672 = wiki_API . normalize_title ( wiki_element_to_key (
2663- value , options ) . trim ( ) ) ;
2673+ value , options ) . toString ( ) . trim ( ) ) ;
26642674 } else if ( invoke_properties && _index === 2 ) {
26652675 invoke_properties . function_name
26662676 // token[2]: lua function name 函式名稱
2667- = wiki_element_to_key ( value , options ) . trim ( )
2677+ = wiki_element_to_key ( value , options )
26682678 // || 'main'
26692679 ;
26702680 } else {
0 commit comments