mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.6.3.4'
This commit is contained in:
@@ -83,6 +83,7 @@ public class Xow_hdump_mgr__load {
|
||||
wpg_head.Itm__popups().Bind_hover_area_ (hpg_head.Imap_exists());
|
||||
wpg_head.Itm__gallery().Enabled_ (hpg_head.Gallery_packed_exists());
|
||||
wpg_head.Itm__hiero().Enabled_ (hpg_head.Hiero_exists());
|
||||
wpg_head.Itm__timeline().Enabled_ (true);
|
||||
|
||||
// transfer images from Xoh_page to Xoae_page
|
||||
Xoh_img_mgr src_imgs = hpg.Img_mgr();
|
||||
|
||||
@@ -40,7 +40,6 @@ public class Xoh_hdoc_ctx {
|
||||
public Xoh_stat_itm Hzip__stat() {return hzip__stat;} private final Xoh_stat_itm hzip__stat = new Xoh_stat_itm();
|
||||
public Xohz_tag_regy Hzip__xnde__regy() {return hzip__xnde__regy;} private final Xohz_tag_regy hzip__xnde__regy = Xohz_tag_regy_.New_dflt();
|
||||
public Xoh_xnde_dict_reg Hzip__xnde__dict() {return hzip__xnde__dict;} private final Xoh_xnde_dict_reg hzip__xnde__dict = new Xoh_xnde_dict_reg();
|
||||
public int Uid__lnki_nxt() {return ++uid__lnki;} private int uid__lnki;
|
||||
public int Uid__gly__nxt() {return ++uid__gly;} private int uid__gly;
|
||||
public boolean Mode_is_diff() {return mode_is_diff;} private boolean mode_is_diff; public void Mode_is_diff_(boolean v) {mode_is_diff = v;}
|
||||
public void Init_by_app(Xoa_app app) {
|
||||
@@ -65,7 +64,6 @@ public class Xoh_hdoc_ctx {
|
||||
}
|
||||
private void Clear() {
|
||||
hzip__stat.Clear();
|
||||
this.uid__lnki = 1; // NOTE: should be 0, but for historical reasons, 1st lnki starts at 2; EX: id='xowa_lnki_2'
|
||||
this.uid__gly = -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,8 +175,8 @@ public class Xoh_lnki_hzip implements Xoh_hzip_wkr, Gfo_poolable_itm {
|
||||
case Xoh_anch_cls_.Tid__voyage__email: cls_bry = Xoh_anch_cls_.Bry__voyage_email; break;
|
||||
}
|
||||
if (cls_bry != null) bfr.Add(Gfh_bldr_.Bry__cls__nth).Add(cls_bry);
|
||||
if (!hctx.Mode_is_diff()) {
|
||||
if (html_uid == -1) html_uid = hctx.Uid__lnki_nxt(); // html_uid == -1 for non-lnkis
|
||||
if ( !hctx.Mode_is_diff() // do not add id during hzip_diff
|
||||
&& href_type != Xoh_anch_href_data.Tid__inet) { // lnke should not get id
|
||||
bfr.Add(Gfh_bldr_.Bry__id__nth).Add_str_a7(gplx.xowa.wikis.pages.lnkis.Xopg_lnki_list.Lnki_id_prefix).Add_int_variable(html_uid);
|
||||
}
|
||||
if ( href_type != Xoh_anch_href_data.Tid__anch) { // anchs never have title;
|
||||
|
||||
@@ -15,8 +15,12 @@ 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.htmls.core.wkrs.lnkis.htmls; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.*; import gplx.xowa.htmls.core.wkrs.*; import gplx.xowa.htmls.core.wkrs.lnkis.*;
|
||||
public class Xoh_redlink_utl {
|
||||
public static final byte[] Cls_bry = Bry_.new_a7("class='new'");
|
||||
public static final String New_str = "new";
|
||||
package gplx.xowa.htmls.tocs; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*;
|
||||
class Xoh_toc_wtr {
|
||||
private final Bry_bfr bfr = Bry_bfr_.New();
|
||||
public void Clear() {
|
||||
bfr.Clear();
|
||||
}
|
||||
public void Add(byte[] hdr_text) { // text within hdr; EX: <h2>Abc</h2> -> Abc
|
||||
}
|
||||
}
|
||||
69
400_xowa/src/gplx/xowa/htmls/tocs/Xoh_toc_wtr_tst.java
Normal file
69
400_xowa/src/gplx/xowa/htmls/tocs/Xoh_toc_wtr_tst.java
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
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.htmls.tocs; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*;
|
||||
import org.junit.*;
|
||||
public class Xoh_toc_wtr_tst {
|
||||
@Before public void init() {fxt.Clear();} private final Xoh_toc_wtr_fxt fxt = new Xoh_toc_wtr_fxt();
|
||||
@Test public void Ws() {
|
||||
fxt.Test__add(" a b ", "a b");
|
||||
}
|
||||
@Test public void Apos__italic() {
|
||||
fxt.Test__add("<i>a</i>", "<i>a</i>");
|
||||
}
|
||||
@Test public void Xnde__small() {
|
||||
fxt.Test__add("<small>a</small>", "a");
|
||||
}
|
||||
@Test public void Xnde__nest__xnde() { // <sup> removed but not <small>
|
||||
fxt.Test__add("a <sup>b<small>c</small>d</sup> e", "a b<small>c</small>d e");
|
||||
}
|
||||
@Test public void Xnde__nest__lnki() { // <small> and <a> removed
|
||||
fxt.Test__add("<small><a href=\"/wiki/A\">b</a></small>", "b");
|
||||
}
|
||||
@Test public void Xnde__nest__inline() { // PURPOSE: do not render inline xndes; EX: Magnetic_resonance_imaging
|
||||
fxt.Test__add("a<span id='b'>b<br/></span>", "ab");
|
||||
}
|
||||
@Test public void Lnki__caption() {
|
||||
fxt.Test__add("<a href=\"/wiki/A\">b</a>", "b");
|
||||
}
|
||||
@Test public void Lnki__caption__nest() {
|
||||
fxt.Test__add("<a href=\"/wiki/A\">b<i>c</i>d</a>", "b<i>c</i>d");
|
||||
}
|
||||
@Test public void Amp__ncr() {
|
||||
fxt.Test__add("[a]", "[a]");
|
||||
}
|
||||
@Test public void Ref() { // PURPOSE: ref contents should not print in TOC; DATE:2013-07-23
|
||||
fxt.Test__add("a<sup id=\"cite_ref-0\" class=\"reference\"><a href=\"#cite_note-0\">[1]</a></sup>", "a");
|
||||
}
|
||||
@Test public void Category__literal() { // PURPOSE: literal Category should show in in TOC; EX: de.w:1234; DATE:2014-01-21
|
||||
fxt.Test__add("A<a href=\"/wiki/Category:B\">Category:B</a>", "ACategory:B");
|
||||
}
|
||||
@Test public void File() { // PURPOSE: file should show in in TOC; EX: tr.w:D<>nya_Miraslari; DATE:2014-06-06
|
||||
fxt.Test__add
|
||||
( "<a href=\"/wiki/File:A.png\" class=\"image\" xowa_title=\"A.png\"><img id=\"xoimg_0\" alt=\"\" src=\"file:///mem/wiki/repo/trg/orig/7/0/A.png\" width=\"0\" height=\"0\" /></a> b"
|
||||
, " b");
|
||||
}
|
||||
@Test public void Translate_w_comment() { // PURPOSE: <translate> is an xtn and parses its innerText separately; meanwhile, toc_mgr defaults to using the innerText to build toc; EX:Wikidata:Introduction; DATE:2013-07-16
|
||||
fxt.Test__add("<translate><!--b-->ac</translate>", "ac");
|
||||
}
|
||||
}
|
||||
class Xoh_toc_wtr_fxt {
|
||||
private final Xoh_toc_wtr wtr = new Xoh_toc_wtr();
|
||||
public void Clear() {wtr.Clear();}
|
||||
public void Test__add(String html, String expd_text) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user