Libraryless. Click here for Pure Java version (5252L/33K).
1 | sS cleanSkypeMsg(S content) { |
2 | LS tok = htmlTok(content); |
3 | new StringBuilder out; |
4 | for (int i = 0; i < l(tok); i++) { |
5 | ifdef cleanSkypeMsg_debug printVars(+i, t := tok.get(i)); endifdef |
6 | if (odd(i)) { |
7 | S tag = getTag(tok.get(i)); |
8 | ifdef cleanSkypeMsg_debug printVars(+i, +tag); endifdef |
9 | if (!startsWith(tag, "/") && !eqicOneOf(tag, "b", "i", "at")) { |
10 | // skip any other tags |
11 | |
12 | if (eqic(tag, "ss")) out.append(":" + tagParam(tok.get(i), "type") + ":"); |
13 | |
14 | int j = findEndOfContainerTag(tok, i); |
15 | i = j < 0 ? l(tok) : j-1; |
16 | } |
17 | ifdef cleanSkypeMsg_debug printVars(+i); endifdef |
18 | } else |
19 | out.append(htmlDecode(tok.get(i))); |
20 | } |
21 | ret str(out); |
22 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1031496 |
Snippet name: | cleanSkypeMsg (from tags and mentions) |
Eternal ID of this version: | #1031496/5 |
Text MD5: | 8f1399ad288ac18bb8fbc81554ae2be2 |
Transpilation MD5: | 31a54ccd5e5597a7cb8485a4f3075f14 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-16 16:20:29 |
Source code size: | 748 bytes / 22 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 184 / 261 |
Version history: | 4 change(s) |
Referenced in: | [show references] |