mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.8.3.1
This commit is contained in:
@@ -58,13 +58,13 @@ public class Scrib_invoke_func extends Pf_func_base {
|
||||
}
|
||||
catch (Exception e) {
|
||||
Error(bfr, wiki.Msg_mgr(), e);
|
||||
bfr.Add(Html_tag_.Comm_bgn).Add_str(Err_.Message_lang(e)).Add(Html_tag_.Comm_end);
|
||||
String invoke_error = String_.Replace(Err_.Message_gplx_log(e), "\n", ""); // NOTE: replace \n as error may have excerpt which will have \n
|
||||
Err err = Err_.cast_or_make(e);
|
||||
bfr.Add(Html_tag_.Comm_bgn).Add_str(err.To_str__full()).Add(Html_tag_.Comm_end);
|
||||
Scrib_err_filter_mgr err_filter_mgr = invoke_wkr == null ? null : invoke_wkr.Err_filter_mgr();
|
||||
if ( err_filter_mgr == null // no err_filter_mgr defined;
|
||||
|| err_filter_mgr.Count_eq_0() // err_filter_mgr exists, but no definitions
|
||||
|| !err_filter_mgr.Match(String_.new_u8(mod_name), String_.new_u8(fnc_name), invoke_error)) // err_filter_mgr has defintion and it doesn't match current; print warn; DATE:2015-07-24
|
||||
ctx.App().Usr_dlg().Warn_many("", "", "invoke failed: ~{0} ~{1} ~{2}", ctx.Cur_page().Ttl().Raw(), String_.new_u8(src, self.Src_bgn(), self.Src_end()), String_.Replace(Err_.Message_gplx_log(e), "\n", "\t"));
|
||||
if ( err_filter_mgr == null // no err_filter_mgr defined;
|
||||
|| err_filter_mgr.Count_eq_0( ) // err_filter_mgr exists, but no definitions
|
||||
|| !err_filter_mgr.Match(String_.new_u8(mod_name), String_.new_u8(fnc_name), err.To_str__msg_only())) // NOTE: must be To_str__msg_only; err_filter_mgr has defintion and it doesn't match current; print warn; DATE:2015-07-24
|
||||
ctx.App().Usr_dlg().Warn_many("", "", "invoke failed: ~{0} ~{1} ~{2}", ctx.Cur_page().Ttl().Raw(), String_.new_u8(src, self.Src_bgn(), self.Src_end()), err.To_str__log(), "\n", "\t");
|
||||
Scrib_core.Core_invalidate_when_page_changes(); // NOTE: invalidate core when page changes, not for rest of page, else page with many errors will be very slow due to multiple invalidations; PAGE:th.d:all; DATE:2014-10-03
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class Gfo_fld_crt implements Criteria {
|
||||
}
|
||||
public void Val_from_args(Hash_adp args) {throw Err_.new_unimplemented();}
|
||||
public void Val_as_obj_(Object v) {throw Err_.new_unimplemented();}
|
||||
public String XtoStr() {return String_.Concat(Byte_.Xto_str(fld_idx), " ", crt.XtoStr());}
|
||||
public String To_str() {return String_.Concat(Byte_.Xto_str(fld_idx), " ", crt.To_str());}
|
||||
public static Gfo_fld_crt new_(byte fld_idx, Criteria crt) {
|
||||
Gfo_fld_crt rv = new Gfo_fld_crt();
|
||||
rv.fld_idx = fld_idx; rv.crt = crt;
|
||||
|
||||
@@ -48,43 +48,46 @@ public class Scrib_lib_mw implements Scrib_lib {
|
||||
case Proc_loadPackage: return LoadPackage(args, rslt);
|
||||
case Proc_loadPHPLibrary: return LoadPHPLibrary(args, rslt);
|
||||
case Proc_frameExists: return FrameExists(args, rslt);
|
||||
case Proc_parentFrameExists: return ParentFrameExists(args, rslt);
|
||||
case Proc_newChildFrame: return NewChildFrame(args, rslt);
|
||||
case Proc_getExpandedArgument: return GetExpandedArgument(args, rslt);
|
||||
case Proc_getAllExpandedArguments: return GetAllExpandedArguments(args, rslt);
|
||||
case Proc_expandTemplate: return ExpandTemplate(args, rslt);
|
||||
case Proc_preprocess: return Preprocess(args, rslt);
|
||||
case Proc_callParserFunction: return CallParserFunction(args, rslt);
|
||||
case Proc_preprocess: return Preprocess(args, rslt);
|
||||
case Proc_incrementExpensiveFunctionCount: return IncrementExpensiveFunctionCount(args, rslt);
|
||||
case Proc_isSubsting: return IsSubsting(args, rslt);
|
||||
case Proc_newChildFrame: return NewChildFrame(args, rslt);
|
||||
case Proc_getFrameTitle: return GetFrameTitle(args, rslt);
|
||||
case Proc_setTTL: return SetTTL(args, rslt);
|
||||
case Proc_parentFrameExists: return ParentFrameExists(args, rslt); // DEPRECATED:not in Scribunto anymore
|
||||
default: throw Err_.new_unhandled(key);
|
||||
}
|
||||
}
|
||||
public static final int
|
||||
Proc_loadPackage = 0, Proc_loadPHPLibrary = 1
|
||||
, Proc_frameExists = 2, Proc_parentFrameExists = 3
|
||||
, Proc_frameExists = 2, Proc_newChildFrame = 3
|
||||
, Proc_getExpandedArgument = 4, Proc_getAllExpandedArguments = 5
|
||||
, Proc_expandTemplate = 6, Proc_preprocess = 7, Proc_callParserFunction = 8
|
||||
, Proc_expandTemplate = 6, Proc_callParserFunction = 7, Proc_preprocess = 8
|
||||
, Proc_incrementExpensiveFunctionCount = 9, Proc_isSubsting = 10
|
||||
, Proc_newChildFrame = 11, Proc_getFrameTitle = 12, Proc_setTTL = 13
|
||||
, Proc_getFrameTitle = 11, Proc_setTTL = 12
|
||||
, Proc_parentFrameExists = 13
|
||||
;
|
||||
public static final String
|
||||
Invk_loadPackage = "loadPackage", Invk_loadPHPLibrary = "loadPHPLibrary"
|
||||
, Invk_frameExists = "frameExists", Invk_parentFrameExists = "parentFrameExists"
|
||||
, Invk_frameExists = "frameExists", Invk_newChildFrame = "newChildFrame"
|
||||
, Invk_getExpandedArgument = "getExpandedArgument", Invk_getAllExpandedArguments = "getAllExpandedArguments"
|
||||
, Invk_expandTemplate = "expandTemplate", Invk_preprocess = "preprocess", Invk_callParserFunction = "callParserFunction"
|
||||
, Invk_expandTemplate = "expandTemplate", Invk_callParserFunction = "callParserFunction", Invk_preprocess = "preprocess"
|
||||
, Invk_incrementExpensiveFunctionCount = "incrementExpensiveFunctionCount", Invk_isSubsting = "isSubsting"
|
||||
, Invk_newChildFrame = "newChildFrame", Invk_getFrameTitle = "getFrameTitle", Invk_setTTL = "setTTL"
|
||||
, Invk_getFrameTitle = "getFrameTitle", Invk_setTTL = "setTTL"
|
||||
, Invk_parentFrameExists = "parentFrameExists"
|
||||
;
|
||||
private static final String[] Proc_names = String_.Ary
|
||||
( Invk_loadPackage, Invk_loadPHPLibrary
|
||||
, Invk_frameExists, Invk_parentFrameExists
|
||||
, Invk_frameExists, Invk_newChildFrame
|
||||
, Invk_getExpandedArgument, Invk_getAllExpandedArguments
|
||||
, Invk_expandTemplate, Invk_preprocess, Invk_callParserFunction
|
||||
, Invk_expandTemplate, Invk_callParserFunction, Invk_preprocess
|
||||
, Invk_incrementExpensiveFunctionCount, Invk_isSubsting
|
||||
, Invk_newChildFrame, Invk_getFrameTitle, Invk_setTTL
|
||||
, Invk_getFrameTitle, Invk_setTTL
|
||||
, Invk_parentFrameExists
|
||||
);
|
||||
public boolean LoadPackage(Scrib_proc_args args, Scrib_proc_rslt rslt) {
|
||||
String mod_name = args.Pull_str(0);
|
||||
|
||||
@@ -16,7 +16,6 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.scribunto.libs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.scribunto.*;
|
||||
import gplx.core.net.*;
|
||||
public class Scrib_lib_text implements Scrib_lib {
|
||||
public Scrib_lib_text(Scrib_core core) {this.core = core;} private Scrib_core core;
|
||||
public Scrib_lua_mod Mod() {return mod;} private Scrib_lua_mod mod;
|
||||
@@ -35,12 +34,15 @@ public class Scrib_lib_text implements Scrib_lib {
|
||||
case Proc_killMarkers: return KillMarkers(args, rslt);
|
||||
case Proc_getEntityTable: return GetEntityTable(args, rslt);
|
||||
case Proc_init_text_for_wiki: return Init_text_for_wiki(args, rslt);
|
||||
case Proc_jsonEncode: return JsonEncode(args, rslt);
|
||||
case Proc_jsonDecode: return JsonDecode(args, rslt);
|
||||
default: throw Err_.new_unhandled(key);
|
||||
}
|
||||
}
|
||||
private static final int Proc_unstrip = 0, Proc_unstripNoWiki = 1, Proc_killMarkers = 2, Proc_getEntityTable = 3, Proc_init_text_for_wiki = 4;
|
||||
public static final String Invk_unstrip = "unstrip", Invk_unstripNoWiki = "unstripNoWiki", Invk_killMarkers = "killMarkers", Invk_getEntityTable = "getEntityTable", Invk_init_text_for_wiki = "init_text_for_wiki";
|
||||
private static final String[] Proc_names = String_.Ary(Invk_unstrip, Invk_unstripNoWiki, Invk_killMarkers, Invk_getEntityTable, Invk_init_text_for_wiki);
|
||||
private static final int Proc_unstrip = 0, Proc_unstripNoWiki = 1, Proc_killMarkers = 2, Proc_getEntityTable = 3, Proc_init_text_for_wiki = 4, Proc_jsonEncode = 5, Proc_jsonDecode = 6;
|
||||
public static final String Invk_unstrip = "unstrip", Invk_unstripNoWiki = "unstripNoWiki", Invk_killMarkers = "killMarkers", Invk_getEntityTable = "getEntityTable"
|
||||
, Invk_init_text_for_wiki = "init_text_for_wiki", Invk_jsonEncode = "jsonEncode", Invk_jsonDecode = "jsonDecode";
|
||||
private static final String[] Proc_names = String_.Ary(Invk_unstrip, Invk_unstripNoWiki, Invk_killMarkers, Invk_getEntityTable, Invk_init_text_for_wiki, Invk_jsonEncode, Invk_jsonDecode);
|
||||
public boolean Unstrip(Scrib_proc_args args, Scrib_proc_rslt rslt) {return rslt.Init_obj(args.Pull_str(0));} // NOTE: XOWA does not use MediaWiki strip markers; just return original; DATE:2015-01-20
|
||||
public boolean UnstripNoWiki(Scrib_proc_args args, Scrib_proc_rslt rslt) {return rslt.Init_obj(args.Pull_str(0));} // NOTE: XOWA does not use MediaWiki strip markers; just return original; DATE:2015-01-20
|
||||
public boolean KillMarkers(Scrib_proc_args args, Scrib_proc_rslt rslt) {return rslt.Init_obj(args.Pull_str(0));} // NOTE: XOWA does not use MediaWiki strip markers; just return original; DATE:2015-01-20
|
||||
@@ -48,6 +50,21 @@ public class Scrib_lib_text implements Scrib_lib {
|
||||
if (Html_entity_ == null) Html_entity_ = Scrib_lib_text_html_entities.new_();
|
||||
return rslt.Init_obj(Html_entity_);
|
||||
} private static KeyVal[] Html_entity_;
|
||||
public boolean JsonEncode(Scrib_proc_args args, Scrib_proc_rslt rslt) {
|
||||
throw Err_.new_unimplemented();
|
||||
// KeyVal[] kv_ary = args.Pull_kv_ary(0);
|
||||
// int flags = args.Cast_int_or(1, 0);
|
||||
// if (!(flags & Scrib_lib_text__json_util.Flag__preserve_keys)) { // && is_array( $value )
|
||||
// text = Scrib_lib_text__json_util.Reindex_arrays(text, true);
|
||||
// }
|
||||
// byte[] rv = Scrib_lib_text__json_util.Encode(kv_ary, flags && Scrib_lib_text__json_util.Flag__pretty, Scrib_lib_text__json_util.Skip__all);
|
||||
// if (rv == null) throw Err_.new_("scribunto", "mw.text.jsonEncode: Unable to encode value");
|
||||
// return rslt.Init_obj(rv);
|
||||
}
|
||||
public boolean JsonDecode(Scrib_proc_args args, Scrib_proc_rslt rslt) {
|
||||
throw Err_.new_unimplemented();
|
||||
// return false;
|
||||
}
|
||||
public void Notify_wiki_changed() {if (notify_wiki_changed_fnc != null) core.Interpreter().CallFunction(notify_wiki_changed_fnc.Id(), KeyVal_.Ary_empty);}
|
||||
public boolean Init_text_for_wiki(Scrib_proc_args args, Scrib_proc_rslt rslt) {
|
||||
Xow_msg_mgr msg_mgr = core.Wiki().Msg_mgr();
|
||||
@@ -62,51 +79,18 @@ public class Scrib_lib_text implements Scrib_lib {
|
||||
return String_.new_u8(msg_mgr.Val_by_key_obj(Bry_.new_u8(msg_key)));
|
||||
}
|
||||
}
|
||||
class Scrib_lib_text_ {
|
||||
public static KeyVal[] Init_nowiki_protocols(Xowe_wiki wiki) {
|
||||
Bry_bfr bfr = wiki.Utl__bfr_mkr().Get_b128();
|
||||
Ordered_hash protocols = Gfo_protocol_itm.Regy;
|
||||
int len = protocols.Count();
|
||||
List_adp rv = List_adp_.new_();
|
||||
for (int i = 0; i < len; i++) {
|
||||
Gfo_protocol_itm itm = (Gfo_protocol_itm)protocols.Get_at(i);
|
||||
if (itm.Text_ends_w_colon()) { // To convert the protocol into a case-insensitive Lua pattern, we need to replace letters with a character class like [Xx] and insert a '%' before various punctuation.
|
||||
KeyVal kv = Init_nowiki_protocols_itm(bfr, itm);
|
||||
rv.Add(kv);
|
||||
}
|
||||
}
|
||||
bfr.Mkr_rls();
|
||||
return (KeyVal[])rv.To_ary(KeyVal.class);
|
||||
class Scrib_lib_text__json_util {
|
||||
public static KeyVal[] Reindex_arrays(KeyVal[] kv_ary, boolean is_encoding) {
|
||||
return kv_ary;
|
||||
}
|
||||
private static KeyVal Init_nowiki_protocols_itm(Bry_bfr bfr, Gfo_protocol_itm itm) {
|
||||
byte[] key = itm.Key_wo_colon_bry();
|
||||
int end = key.length - 1; // -1 to ignore final colon
|
||||
for (int i = 0; i < end; i++) {
|
||||
byte b = key[i];
|
||||
switch (b) {
|
||||
case Byte_ascii.Ltr_A: case Byte_ascii.Ltr_B: case Byte_ascii.Ltr_C: case Byte_ascii.Ltr_D: case Byte_ascii.Ltr_E:
|
||||
case Byte_ascii.Ltr_F: case Byte_ascii.Ltr_G: case Byte_ascii.Ltr_H: case Byte_ascii.Ltr_I: case Byte_ascii.Ltr_J:
|
||||
case Byte_ascii.Ltr_K: case Byte_ascii.Ltr_L: case Byte_ascii.Ltr_M: case Byte_ascii.Ltr_N: case Byte_ascii.Ltr_O:
|
||||
case Byte_ascii.Ltr_P: case Byte_ascii.Ltr_Q: case Byte_ascii.Ltr_R: case Byte_ascii.Ltr_S: case Byte_ascii.Ltr_T:
|
||||
case Byte_ascii.Ltr_U: case Byte_ascii.Ltr_V: case Byte_ascii.Ltr_W: case Byte_ascii.Ltr_X: case Byte_ascii.Ltr_Y: case Byte_ascii.Ltr_Z:
|
||||
bfr.Add_byte(Byte_ascii.Brack_bgn).Add_byte(b).Add_byte(Byte_ascii.Case_lower(b)).Add_byte(Byte_ascii.Brack_end); // [Aa]
|
||||
break;
|
||||
case Byte_ascii.Ltr_a: case Byte_ascii.Ltr_b: case Byte_ascii.Ltr_c: case Byte_ascii.Ltr_d: case Byte_ascii.Ltr_e:
|
||||
case Byte_ascii.Ltr_f: case Byte_ascii.Ltr_g: case Byte_ascii.Ltr_h: case Byte_ascii.Ltr_i: case Byte_ascii.Ltr_j:
|
||||
case Byte_ascii.Ltr_k: case Byte_ascii.Ltr_l: case Byte_ascii.Ltr_m: case Byte_ascii.Ltr_n: case Byte_ascii.Ltr_o:
|
||||
case Byte_ascii.Ltr_p: case Byte_ascii.Ltr_q: case Byte_ascii.Ltr_r: case Byte_ascii.Ltr_s: case Byte_ascii.Ltr_t:
|
||||
case Byte_ascii.Ltr_u: case Byte_ascii.Ltr_v: case Byte_ascii.Ltr_w: case Byte_ascii.Ltr_x: case Byte_ascii.Ltr_y: case Byte_ascii.Ltr_z:
|
||||
bfr.Add_byte(Byte_ascii.Brack_bgn).Add_byte(Byte_ascii.Case_upper(b)).Add_byte(b).Add_byte(Byte_ascii.Brack_end); // [Aa]
|
||||
break;
|
||||
case Byte_ascii.Paren_bgn: case Byte_ascii.Paren_end: case Byte_ascii.Pow: case Byte_ascii.Dollar: case Byte_ascii.Percent: case Byte_ascii.Dot:
|
||||
case Byte_ascii.Brack_bgn: case Byte_ascii.Brack_end: case Byte_ascii.Star: case Byte_ascii.Plus: case Byte_ascii.Question: case Byte_ascii.Dash:
|
||||
bfr.Add_byte(Byte_ascii.Percent).Add_byte(b); // regex is '/([a-zA-Z])|([()^$%.\[\]*+?-])/'
|
||||
break;
|
||||
default: // ignore
|
||||
break;
|
||||
}
|
||||
}
|
||||
bfr.Add(Colon_encoded);
|
||||
return KeyVal_.new_(itm.Key_wo_colon_str(), bfr.Xto_str_and_clear());
|
||||
} private static final byte[] Colon_encoded = Bry_.new_a7(":");
|
||||
public static final int
|
||||
Flag__preserve_keys = 1
|
||||
, Flag__try_fixing = 2
|
||||
, Flag__pretty = 4
|
||||
;
|
||||
public static final int
|
||||
Skip__utf8 = 1
|
||||
, Skip__xml = 2
|
||||
, Skip__all = 3
|
||||
;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.scribunto.libs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.scribunto.*;
|
||||
import gplx.core.net.*;
|
||||
class Scrib_lib_text_ {
|
||||
public static KeyVal[] Init_nowiki_protocols(Xowe_wiki wiki) {
|
||||
Bry_bfr bfr = wiki.Utl__bfr_mkr().Get_b128();
|
||||
Ordered_hash protocols = Gfo_protocol_itm.Regy;
|
||||
int len = protocols.Count();
|
||||
List_adp rv = List_adp_.new_();
|
||||
for (int i = 0; i < len; i++) {
|
||||
Gfo_protocol_itm itm = (Gfo_protocol_itm)protocols.Get_at(i);
|
||||
if (itm.Text_ends_w_colon()) { // To convert the protocol into a case-insensitive Lua pattern, we need to replace letters with a character class like [Xx] and insert a '%' before various punctuation.
|
||||
KeyVal kv = Init_nowiki_protocols_itm(bfr, itm);
|
||||
rv.Add(kv);
|
||||
}
|
||||
}
|
||||
bfr.Mkr_rls();
|
||||
return (KeyVal[])rv.To_ary(KeyVal.class);
|
||||
}
|
||||
private static KeyVal Init_nowiki_protocols_itm(Bry_bfr bfr, Gfo_protocol_itm itm) {
|
||||
byte[] key = itm.Key_wo_colon_bry();
|
||||
int end = key.length - 1; // -1 to ignore final colon
|
||||
for (int i = 0; i < end; i++) {
|
||||
byte b = key[i];
|
||||
switch (b) {
|
||||
case Byte_ascii.Ltr_A: case Byte_ascii.Ltr_B: case Byte_ascii.Ltr_C: case Byte_ascii.Ltr_D: case Byte_ascii.Ltr_E:
|
||||
case Byte_ascii.Ltr_F: case Byte_ascii.Ltr_G: case Byte_ascii.Ltr_H: case Byte_ascii.Ltr_I: case Byte_ascii.Ltr_J:
|
||||
case Byte_ascii.Ltr_K: case Byte_ascii.Ltr_L: case Byte_ascii.Ltr_M: case Byte_ascii.Ltr_N: case Byte_ascii.Ltr_O:
|
||||
case Byte_ascii.Ltr_P: case Byte_ascii.Ltr_Q: case Byte_ascii.Ltr_R: case Byte_ascii.Ltr_S: case Byte_ascii.Ltr_T:
|
||||
case Byte_ascii.Ltr_U: case Byte_ascii.Ltr_V: case Byte_ascii.Ltr_W: case Byte_ascii.Ltr_X: case Byte_ascii.Ltr_Y: case Byte_ascii.Ltr_Z:
|
||||
bfr.Add_byte(Byte_ascii.Brack_bgn).Add_byte(b).Add_byte(Byte_ascii.Case_lower(b)).Add_byte(Byte_ascii.Brack_end); // [Aa]
|
||||
break;
|
||||
case Byte_ascii.Ltr_a: case Byte_ascii.Ltr_b: case Byte_ascii.Ltr_c: case Byte_ascii.Ltr_d: case Byte_ascii.Ltr_e:
|
||||
case Byte_ascii.Ltr_f: case Byte_ascii.Ltr_g: case Byte_ascii.Ltr_h: case Byte_ascii.Ltr_i: case Byte_ascii.Ltr_j:
|
||||
case Byte_ascii.Ltr_k: case Byte_ascii.Ltr_l: case Byte_ascii.Ltr_m: case Byte_ascii.Ltr_n: case Byte_ascii.Ltr_o:
|
||||
case Byte_ascii.Ltr_p: case Byte_ascii.Ltr_q: case Byte_ascii.Ltr_r: case Byte_ascii.Ltr_s: case Byte_ascii.Ltr_t:
|
||||
case Byte_ascii.Ltr_u: case Byte_ascii.Ltr_v: case Byte_ascii.Ltr_w: case Byte_ascii.Ltr_x: case Byte_ascii.Ltr_y: case Byte_ascii.Ltr_z:
|
||||
bfr.Add_byte(Byte_ascii.Brack_bgn).Add_byte(Byte_ascii.Case_upper(b)).Add_byte(b).Add_byte(Byte_ascii.Brack_end); // [Aa]
|
||||
break;
|
||||
case Byte_ascii.Paren_bgn: case Byte_ascii.Paren_end: case Byte_ascii.Pow: case Byte_ascii.Dollar: case Byte_ascii.Percent: case Byte_ascii.Dot:
|
||||
case Byte_ascii.Brack_bgn: case Byte_ascii.Brack_end: case Byte_ascii.Star: case Byte_ascii.Plus: case Byte_ascii.Question: case Byte_ascii.Dash:
|
||||
bfr.Add_byte(Byte_ascii.Percent).Add_byte(b); // regex is '/([a-zA-Z])|([()^$%.\[\]*+?-])/'
|
||||
break;
|
||||
default: // ignore
|
||||
break;
|
||||
}
|
||||
}
|
||||
bfr.Add(Colon_encoded);
|
||||
return KeyVal_.new_(itm.Key_wo_colon_str(), bfr.Xto_str_and_clear());
|
||||
} private static final byte[] Colon_encoded = Bry_.new_a7(":");
|
||||
}
|
||||
Reference in New Issue
Block a user