1 | static S html_addTargetBlank(S html) {
|
2 | L<S> tok = htmlTok(html); |
3 | for (int i = 1; i < l(tok); i += 2) pcall {
|
4 | S t = tok.get(i); |
5 | if (isTag(t, "a")) {
|
6 | SS map = htmlParams(t); |
7 | if (map.containsKey("href")) {
|
8 | map.put("target", "_blank");
|
9 | tok.set(i, hopeningTag("a", mapToParams(map)));
|
10 | } |
11 | } |
12 | } |
13 | ret join(tok); |
14 | } |
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: | #1011339 |
| Snippet name: | html_addTargetBlank |
| Eternal ID of this version: | #1011339/6 |
| Text MD5: | 75f9f5b0dcdea7c8602237c4d66c5264 |
| Author: | stefan |
| Category: | javax / html |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-11-05 09:07:27 |
| Source code size: | 369 bytes / 14 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 674 / 712 |
| Version history: | 5 change(s) |
| Referenced in: | [show references] |