mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.11.1.1
This commit is contained in:
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.xtns.translates; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.primitives.*;
|
||||
import gplx.xowa.wikis.nss.*;
|
||||
import gplx.xowa.htmls.*; import gplx.xowa.htmls.hrefs.*; import gplx.xowa.langs.*; import gplx.xowa.wikis.data.tbls.*;
|
||||
import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.htmls.hrefs.*; import gplx.xowa.langs.*; import gplx.xowa.wikis.data.tbls.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*;
|
||||
public class Xop_languages_xnde implements Xox_xnde {
|
||||
public Xop_xnde_tkn Xnde() {return xnde;} private Xop_xnde_tkn xnde;
|
||||
@@ -31,7 +31,7 @@ public class Xop_languages_xnde implements Xox_xnde {
|
||||
private Xoa_ttl Root_ttl_of(Xowe_wiki wiki, Xoa_ttl ttl) {
|
||||
byte[] page_bry = ttl.Page_db();
|
||||
int slash_pos = Bry_find_.Find_bwd(page_bry, Xoa_ttl.Subpage_spr);
|
||||
if (slash_pos == Bry_.NotFound) return ttl;
|
||||
if (slash_pos == Bry_find_.Not_found) return ttl;
|
||||
byte[] root_bry = Bry_.Mid(page_bry, 0, slash_pos);
|
||||
return Xoa_ttl.parse(wiki, ttl.Ns().Id(), root_bry);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ 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.translates; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.xowa.htmls.*;
|
||||
import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.htmls.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.htmls.*;
|
||||
public class Xop_translate_xnde implements Xox_xnde {
|
||||
public Xop_root_tkn Xtn_root() {return xtn_root;} private Xop_root_tkn xtn_root;
|
||||
|
||||
@@ -25,8 +25,8 @@ public class Xop_tvar_lxr implements Xop_lxr {
|
||||
public void Term(Btrie_fast_mgr core_trie) {}
|
||||
private static final byte[] Hook_bgn = Bry_.new_a7("<tvar|"), Close_nde = Bry_.new_a7("</>");
|
||||
public int Make_tkn(Xop_ctx ctx, Xop_tkn_mkr tkn_mkr, Xop_root_tkn root, byte[] src, int src_len, int bgn_pos, int cur_pos) {
|
||||
int rhs_end = Bry_find_.Find_fwd(src, Byte_ascii.Gt, cur_pos); if (rhs_end == Bry_.NotFound) return ctx.Lxr_make_txt_(cur_pos);
|
||||
int lhs_bgn = Bry_find_.Find_fwd(src, Close_nde , rhs_end); if (lhs_bgn == Bry_.NotFound) return ctx.Lxr_make_txt_(cur_pos);
|
||||
int rhs_end = Bry_find_.Find_fwd(src, Byte_ascii.Gt, cur_pos); if (rhs_end == Bry_find_.Not_found) return ctx.Lxr_make_txt_(cur_pos);
|
||||
int lhs_bgn = Bry_find_.Find_fwd(src, Close_nde , rhs_end); if (lhs_bgn == Bry_find_.Not_found) return ctx.Lxr_make_txt_(cur_pos);
|
||||
byte[] body = Bry_.Mid(src, rhs_end + Int_.Const_position_after_char, lhs_bgn);
|
||||
Xop_ctx sub_ctx = Xop_ctx.new_sub_(ctx.Wiki());
|
||||
Xop_root_tkn sub_root = tkn_mkr.Root(body);
|
||||
|
||||
Reference in New Issue
Block a user