Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

16
LINES

< > BotCompany Repo | #1009190 // findTag - find tag in HTML/XML text (just the opening/standalone tag)

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (2190L) is out of date.

1  
// tok = parsed with htmlTok
2  
sS findTag(L<S> tok, S tag) {
3  
  for (int i = 1; i < l(tok); i += 2)
4  
    if (isTag(tok.get(i), tag))
5  
      ret tok.get(i);
6  
  null;
7  
}
8  
9  
sS mapMethodLike findTag(S tag, LS tok) {
10  
  ret findTag(tok, tag);
11  
}
12  
13  
// Note the reversed parameters
14  
sS mapMethodLike findTag(S tag, S html) {
15  
  ret findTag(htmlTok(html), tag);
16  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009190
Snippet name: findTag - find tag in HTML/XML text (just the opening/standalone tag)
Eternal ID of this version: #1009190/4
Text MD5: 372762e64fede4bbc29f50c8b26dde20
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-29 13:47:11
Source code size: 357 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 584 / 634
Version history: 3 change(s)
Referenced in: [show references]