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

15
LINES

< > BotCompany Repo | #1008452 // dropHTMLComments

JavaX fragment (include)

1  
static L<S> dropHTMLComments(L<S> tok) {
2  
  new L<S> l;
3  
  for idx over tok: {
4  
    S t = tok.get(idx);
5  
    if (even(idx)) {
6  
      int i;
7  
      while ((i = t.indexOf("<!--")) >= 0) {
8  
        int j = smartIndexOf(t, "-->", i+4);
9  
        t = substring(t, 0, i) + substring(t, j+3);
10  
      }
11  
    }
12  
    l.add(t);
13  
  }
14  
  ret l;
15  
}

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: #1008452
Snippet name: dropHTMLComments
Eternal ID of this version: #1008452/3
Text MD5: dab3f2c8573ac58190831d0167e8b59d
Author: stefan
Category: javax / html parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-16 00:00:17
Source code size: 333 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 503 / 597
Version history: 2 change(s)
Referenced in: [show references]