mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
uca category support and other changes
This commit is contained in:
@@ -84,6 +84,7 @@ public class Xop_tkn_mkr {
|
||||
public gplx.xowa.xtns.quiz.Quiz_xnde Xnde__quiz() {return new gplx.xowa.xtns.quiz.Quiz_xnde();}
|
||||
public gplx.xowa.xtns.indicators.Indicator_xnde Xnde__indicator() {return new gplx.xowa.xtns.indicators.Indicator_xnde();}
|
||||
public gplx.xowa.xtns.xowa_cmds.Xox_xowa_html_cmd Xnde__xowa_html() {return new gplx.xowa.xtns.xowa_cmds.Xox_xowa_html_cmd();}
|
||||
public gplx.xowa.xtns.xowa_cmds.wiki_setups.Xop_wiki_setup_xnde Xnde__xowa_wiki_setup() {return new gplx.xowa.xtns.xowa_cmds.wiki_setups.Xop_wiki_setup_xnde();}
|
||||
public gplx.xowa.xtns.listings.Listing_xnde Xnde__listing(int tag_id) {return new gplx.xowa.xtns.listings.Listing_xnde(tag_id);}
|
||||
public gplx.xowa.xtns.scores.Score_xnde Xnde__score() {return new gplx.xowa.xtns.scores.Score_xnde();}
|
||||
public gplx.xowa.xtns.inputBox.Xtn_inputbox_nde Xnde__inputbox() {return new gplx.xowa.xtns.inputBox.Xtn_inputbox_nde();}
|
||||
|
||||
@@ -169,11 +169,14 @@ public class Xop_lnke_wkr implements Xop_ctx_wkr {
|
||||
&& Bry_.Match(src, site_bgn, site_end, xwiki.Domain_bry()) // only consider full domains, not alliases; EX: [http://w/b] should not match alias of w for en.wikipedia.org
|
||||
) {
|
||||
Xowe_wiki wiki = ctx.Wiki();
|
||||
xo_url_parser_url = wiki.Utl__url_parser().Parse(src, lnke_bgn, lnke_end);
|
||||
|
||||
// HACK: this is not correct; "=" or "&" is not handled by Gfo_url_parser which assumes that all "&" separates qargs; DATE:2016-10-10
|
||||
byte[] decoded_src = gplx.xowa.parsers.amps.Xop_amp_mgr.Instance.Decode_as_bry(Bry_.Mid(src, lnke_bgn, lnke_end));
|
||||
xo_url_parser_url = wiki.Utl__url_parser().Parse(decoded_src, 0, decoded_src.length);
|
||||
|
||||
byte[] xwiki_wiki = xo_url_parser_url.Wiki_bry();
|
||||
byte[] xwiki_page = xo_url_parser_url.Page_bry();
|
||||
byte[] ttl_bry = xo_url_parser_url.Page_bry();
|
||||
Xoa_ttl ttl = Xoa_ttl.Parse(wiki, ttl_bry);
|
||||
Xoa_ttl ttl = Xoa_ttl.Parse(wiki, xwiki_page);
|
||||
if (ttl != null && ttl.Wik_itm() != null) {
|
||||
xwiki_wiki = ttl.Wik_itm().Domain_bry();
|
||||
xwiki_page = ttl.Page_url();
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.parsers.lnkes; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
|
||||
import org.junit.*;
|
||||
public class Xop_lnke_wkr_xwiki_tst {
|
||||
@Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt();
|
||||
@Before public void init() {fxt.Reset();} private final Xop_fxt fxt = new Xop_fxt();
|
||||
@Test public void Xwiki() {
|
||||
fxt.App().Usere().Wiki().Xwiki_mgr().Add_by_atrs(Bry_.new_a7("en.wikipedia.org"), Bry_.new_a7("en.wikipedia.org"));
|
||||
fxt.Test__parse__wtxt_to_html("[http://en.wikipedia.org/wiki/A a]", "<a href='/site/en.wikipedia.org/wiki/A'>a</a>");
|
||||
@@ -49,7 +49,11 @@ public class Xop_lnke_wkr_xwiki_tst {
|
||||
}
|
||||
@Test public void Xwiki__qargs() { // PURPOSE: fix null ref error; PAGE:en.w:Wikipedia:Template_standardisation/demometa DATE:2015-08-02
|
||||
fxt.Init_xwiki_add_user_("en.wikipedia.org");
|
||||
fxt.Test__parse__wtxt_to_html("[http://en.wikipedia.org/w/index.php?action=edit&preload=Template:Afd2+starter&editintro=Template:Afd3+starter&title=Wikipedia:Articles+for+deletion/Template_standardisation/demometa]"
|
||||
, "<a href='/site/en.wikipedia.org/wiki/index.php?action==edit=&preload==Template:Afd2+starter=&editintro==Template:Afd3+starter=&title=&='>[1]</a>");
|
||||
fxt.Test__parse__wtxt_to_html
|
||||
( "[http://en.wikipedia.org/w/index.php?action=edit&preload=Template:Afd2+starter&editintro=Template:Afd3+starter&title=Wikipedia:Articles+for+deletion/Template_standardisation/demometa]"
|
||||
// CHANGED: lnke_now decodes html_entities; DATE:2016-10-10
|
||||
//, "<a href='/site/en.wikipedia.org/wiki/index.php?action==edit=&preload==Template:Afd2+starter=&editintro==Template:Afd3+starter=&title=&='>[1]</a>"
|
||||
, "<a href='/site/en.wikipedia.org/wiki/Wikipedia:Articles+for+deletion/Template_standardisation/demometa?action=edit&preload=Template:Afd2+starter&editintro=Template:Afd3+starter&title=Wikipedia:Articles+for+deletion/Template_standardisation/demometa'>[1]</a>"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,8 +142,9 @@ public class Xop_xnde_tag_ {
|
||||
, Tid__random_selection = 115
|
||||
, Tid__tabber = 116
|
||||
, Tid__tabview = 117
|
||||
, Tid__xowa_wiki_setup = 118
|
||||
;
|
||||
public static final int Tid__len = 118;
|
||||
public static final int Tid__len = 119;
|
||||
public static final Xop_xnde_tag[] Ary = new Xop_xnde_tag[Tid__len];
|
||||
private static Xop_xnde_tag New(int id, String name) {
|
||||
Xop_xnde_tag rv = new Xop_xnde_tag(id, name);
|
||||
@@ -269,5 +270,6 @@ public class Xop_xnde_tag_ {
|
||||
, Tag__random_selection = New(Tid__random_selection, "choose").Xtn_mw_()
|
||||
, Tag__tabber = New(Tid__tabber, "tabber").Xtn_mw_()
|
||||
, Tag__tabview = New(Tid__tabview, "tabview").Xtn_mw_()
|
||||
, Tag__xowa_wiki_setup = New(Tid__xowa_wiki_setup, "xowa_Wiki_setup").Xtn_()
|
||||
;
|
||||
}
|
||||
|
||||
@@ -646,6 +646,7 @@ public class Xop_xnde_wkr implements Xop_ctx_wkr {
|
||||
case Xop_xnde_tag_.Tid__quiz: xnde_xtn = tkn_mkr.Xnde__quiz(); break;
|
||||
case Xop_xnde_tag_.Tid__indicator: xnde_xtn = tkn_mkr.Xnde__indicator(); break;
|
||||
case Xop_xnde_tag_.Tid__xowa_html: xnde_xtn = tkn_mkr.Xnde__xowa_html(); break;
|
||||
case Xop_xnde_tag_.Tid__xowa_wiki_setup: xnde_xtn = tkn_mkr.Xnde__xowa_wiki_setup(); break;
|
||||
case Xop_xnde_tag_.Tid__graph: xnde_xtn = tkn_mkr.Xnde__graph(); break;
|
||||
case Xop_xnde_tag_.Tid__random_selection: xnde_xtn = tkn_mkr.Xnde__random_selection(); break;
|
||||
case Xop_xnde_tag_.Tid__tabber: xnde_xtn = tkn_mkr.Xnde__tabber(); break;
|
||||
|
||||
Reference in New Issue
Block a user