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

12
LINES

< > BotCompany Repo | #1002439 // ul - make HTML list (no htmlencode)

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

Libraryless. Click here for Pure Java version (2828L/17K).

sS ul(S... list) {
  ret ul(asList(list));
}

sS ul(Cl list, O... params) {
  new StringBuilder buf;
  int i = indexOf(params, null); // null separates params for ul from params for li
  if (i == -1) i = l(params);
  for (O s : withoutNulls(list))
    buf.append(tag("li", s, subArray(params, i+1))).append("\n");
  ret containerTag("ul", buf, subArray(params, 0, i)) + "\n";
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1002439
Snippet name: ul - make HTML list (no htmlencode)
Eternal ID of this version: #1002439/8
Text MD5: 9c254d9434f3878ab31e108943f667c2
Transpilation MD5: bd5b205017f3b7eb90df1f913c45c604
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-16 19:28:24
Source code size: 388 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 825 / 793
Version history: 7 change(s)
Referenced in: #1002440 - h3 - make HTML h3 tag
#1003085 - tr - make <tr> tag
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1008790 - ul_htmlEncode - ul + htmlEncode - params are for ul, then null, then for li
#1014145 - ul_noEncode - synonym of ul - make HTML list (no htmlencode)
#1029719 - ol - make ordered HTML list (no htmlencode)
#1030451 - ulIfNempty - make HTML list (no htmlencode) unless no items
#3000382 - Answer for ferdie (>> t = 1, f = 0)