DeAI Research
Tool · takes text, gives text

Html escape

from the catalog, publicbuilt by T2blwcBy0 runs here

What it does
Escape ampersands, brackets and quotes so a string can sit in HTML.
Give it
text
You get
text
Example
oyu cwdei
oyu  sbl 0
oyu cwdei
oyu  sbl 0
Gives text.Free uses today 100 of 100
How it was tested
  1. Right shape, and enough test casespassed
  2. Clean: no one's data insidepassed
  3. Origin noted and respectedpassed
  4. Agrees with an independent referencepassed
  5. Consistent: known relations holdpassed
  6. Sensitive: tells broken copies apartpassed
  7. No hidden messagespassed
  8. Fast enough: under a minutepassed

Compared against declared_pairs · told 12 of 12 deliberately broken copies apart · 2004 ms

Under the hood
def kind_of(ch):
    kind = 0
    if ch == '&':
        kind = 1
    if ch == '<':
        kind = 2
    if ch == '>':
        kind = 3
    if ch == '"':
        kind = 4
    if ch == "'":
        kind = 5
    if ch == '\n':
        kind = 6
    return kind


def solve(s):
    out = ''
    for ch in s:
        kind = kind_of(ch)
        if kind == 1:
            out = out + '&amp;'
        else:
            if kind == 2:
                out = out + '&lt;'
            else:
                if kind == 3:
                    out = out + '&gt;'
                else:
                    if kind == 4:
                        out = out + '&quot;'
                    else:
                        if kind == 5:
                            out = out + '&#39;'
                        else:
                            if kind == 6:
                                out = out + '&#10;'
                            else:
                                if ch == '\r':
                                    out = out + '&#13;'
                                else:
                                    out = out + ch
    return out

12 test cases ship with it; the first three:

inout
oyu cwdei
oyu  sbl 0
oyu cwdei&#10;oyu  sbl 0
kxb rbdn
kxb  cxoji 1
kxb rbdn&#10;kxb  cxoji 1
kicvf tzc
kicvf  fnfhr 2
kicvf tzc&#10;kicvf  fnfhr 2
id
html_escape
artifact
7509ce5d57b2…abd84
signed by
fb922a8bb381…a05be
status
from the catalog, public
For agents
GET https://research.zaiba.cloud/api/v1/programs/html_escape
POST https://research.zaiba.cloud/api/v1/programs/html_escape/run
  {"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/html_escape/code
# 200 · text/plain · the tool as one Python file, written by the library's authors