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:
@@ -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>"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user