示例#1
0
 public boolean Parse1(
     Xoh_hdoc_wkr hdoc_wkr,
     Xoh_hdoc_ctx hctx,
     Gfh_tag_rdr tag_rdr,
     byte[] src,
     Gfh_tag anch_head) {
   Init(src);
   this.src_bgn = anch_head.Src_bgn();
   rdr.Init_by_wkr(tag_rdr.Err_wkr(), "lnki", src_bgn, src.length);
   Gfh_atr title_atr = anch_head.Atrs__get_by_or_empty(Gfh_atr_.Bry__title);
   Parse_href(hctx, anch_head);
   Parse_cls(anch_head);
   Parse_capt(tag_rdr, anch_head);
   Parse_title(title_atr);
   hdoc_wkr.On_lnki(this);
   return true;
 }
示例#2
0
 private void Parse_href(Xoh_hdoc_ctx hctx, Gfh_tag anch_head) {
   href_itm.Parse(rdr.Err_wkr(), hctx, src, anch_head);
   this.href_bgn = href_itm.Ttl_bgn();
   this.href_end = href_itm.Ttl_end();
   switch (href_itm.Tid()) {
     case Xoh_anch_href_data.Tid__wiki:
     case Xoh_anch_href_data.Tid__site:
       this.href_ns_id = href_itm.Ttl_ns_id();
       this.href_src = href_itm.Ttl_full_txt();
       this.href_bgn = 0;
       this.href_end = href_src.length;
       if (href_ns_id != Xow_ns_.Tid__main) { // not main; try to remove template name;		
         int colon_pos = Bry_find_.Find_fwd(href_src, Byte_ascii.Colon, href_bgn, href_end);
         this.href_ns_name =
             Xoa_ttl.Replace_unders(
                 Bry_.Mid(href_src, href_bgn, colon_pos + 1)); // EX: 11="Template talk:"
         this.href_ns_name_len = href_ns_name.length;
       }
       break;
   }
 }