1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

'v3.9.4.1'

This commit is contained in:
gnosygnu
2016-09-25 22:05:47 -04:00
parent 35d78f6106
commit e3b393650d
211 changed files with 3148 additions and 2197 deletions

View File

@@ -76,6 +76,7 @@ public class Gfh_tag_ { // NOTE: not serialized; used by tag_rdr
, Id__blockquote = 52
, Id__map = 53
, Id__bdo = 54
, Id__time = 55
;
// private static final int Id__ary_max = 54;
public static final byte[]
@@ -156,6 +157,7 @@ public class Gfh_tag_ { // NOTE: not serialized; used by tag_rdr
.Add_str_int("blockquote" , Id__blockquote)
.Add_str_int("map" , Id__map)
.Add_str_int("bdo" , Id__bdo)
.Add_str_int("time" , Id__time)
;
public static String To_str(int tid) {
switch (tid) {
@@ -217,6 +219,7 @@ public class Gfh_tag_ { // NOTE: not serialized; used by tag_rdr
case Id__blockquote: return "blockquote";
case Id__map: return "map";
case Id__bdo: return "bdo";
case Id__time: return "time";
default: throw Err_.new_unhandled(tid);
}
}

View File

@@ -85,6 +85,13 @@ public class Gfo_url_encoder_ {
return new Gfo_url_encoder_mkr().Init(Byte_ascii.Percent).Init_common(Bool_.Y)
.Init__same__many(Byte_ascii.Paren_bgn, Byte_ascii.Paren_end, Byte_ascii.Apos, Byte_ascii.Semic);
}
public static Gfo_url_encoder_mkr New__mw_ttl() {
return new Gfo_url_encoder_mkr().Init(Byte_ascii.Percent)
.Init__same__rng(0, 255)
.Init__diff__many(Byte_ascii.Percent, Byte_ascii.Amp, Byte_ascii.Apos, Byte_ascii.Eq, Byte_ascii.Plus)
.Init__diff__one(Byte_ascii.Space, Byte_ascii.Underline)
;
}
public static final Gfo_url_encoder
Id = Gfo_url_encoder_.New__html_id().Make()
, Href = Gfo_url_encoder_.New__html_href_mw(Bool_.Y).Make()
@@ -95,5 +102,6 @@ public class Gfo_url_encoder_ {
, Xourl = Gfo_url_encoder_.New__html_href_mw(Bool_.Y).Init__same__many(Byte_ascii.Underline).Make()
, Http_url = Gfo_url_encoder_.New__http_url().Make()
, Http_url_ttl = Gfo_url_encoder_.New__http_url_ttl().Make()
, Mw_ttl = Gfo_url_encoder_.New__mw_ttl().Make()
;
}

View File

@@ -32,6 +32,8 @@ public class Gfo_url_encoder_tst {
fxt.Encoder_id().Encoder().Decode(tmp_bfr, Bool_.N, raw, 0, raw.length);
Tfds.Eq("0%.jpg", tmp_bfr.To_str_and_clear());
}
@Test public void Ttl__syms__diff() {fxt.Encoder_ttl().Test__encode(" &'=+", "_%26%27%3D%2B");}
@Test public void Ttl__syms__same() {fxt.Encoder_ttl().Test__encode("!\"#$%()*,-./:;<>?@[\\]^_`{|}~", "!\"#$%()*,-./:;<>?@[\\]^_`{|}~");}
@Test public void Url__syms() {fxt.Encoder_url().Test__bicode("!?^~", "%21%3F%5E%7E");}
@Test public void Url__foreign() {fxt.Encoder_url().Test__bicode("aéb", "a%C3%A9b");}
@Test public void Url__space() {fxt.Encoder_url().Test__bicode("a b", "a+b");}
@@ -54,6 +56,7 @@ class Gfo_url_encoder_fxt {
public Gfo_url_encoder_fxt Encoder_id() {encoder = Gfo_url_encoder_.Id; return this;}
public Gfo_url_encoder_fxt Encoder_href() {encoder = Gfo_url_encoder_.Href; return this;}
public Gfo_url_encoder_fxt Encoder_url() {encoder = Gfo_url_encoder_.Http_url; return this;}
public Gfo_url_encoder_fxt Encoder_ttl() {encoder = Gfo_url_encoder_.Mw_ttl; return this;}
public Gfo_url_encoder_fxt Encoder_fsys_safe() {encoder = Gfo_url_encoder_.New__fsys_wnt().Make(); return this;}
public void Test__bicode(String raw, String encoded) {
Test__encode(raw, encoded);