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

15
LINES

< > BotCompany Repo | #1008452 // dropHTMLComments

JavaX fragment (include)

static L<S> dropHTMLComments(L<S> tok) {
  new L<S> l;
  for idx over tok: {
    S t = tok.get(idx);
    if (even(idx)) {
      int i;
      while ((i = t.indexOf("<!--")) >= 0) {
        int j = smartIndexOf(t, "-->", i+4);
        t = substring(t, 0, i) + substring(t, j+3);
      }
    }
    l.add(t);
  }
  ret l;
}

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: 502 / 595
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1028644 - getHTMLComments - returns them without the enclosing <!-- and -->