~/bend-docscommunity

src/html.bend checks

raw source on the hub · import emerging-ezhttp@0.14.0.0/src/html.bend as Html

ezhttp/src/html: HTML escaping, the way markupsafe.escape and Jinja's autoescape do it. &, <, >, " and ' are written as &amp;, &lt;, &gt;, &#34; and &#39;; every other character is written as itself. SPEC.md HTTP-HTML lists what is guaranteed.

1 import
import Base

Definitions

def one.sq source · line 8 · raw

@+c:Char -> @rest:String -> @hit:Bool -> String

one character that is not &, <, > or ", as ' or as itself

def one.dq source · line 16 · raw

@+c:Char -> @rest:String -> @hit:Bool -> String

one character that is not &, < or >

def one.gt source · line 24 · raw

@+c:Char -> @rest:String -> @hit:Bool -> String

one character that is not & or <

def one.lt source · line 32 · raw

@+c:Char -> @rest:String -> @hit:Bool -> String

one character that is not &

def one.amp source · line 40 · raw

@+c:Char -> @rest:String -> @hit:Bool -> String

one character, once it is known whether it is &

def one source · line 48 · raw

@+c:Char -> @rest:String -> String

one character as it is escaped, followed by rest

def escape.onto source · line 52 · raw

@s:String -> @rest:String -> String

a string escaped, each character in turn, followed by rest

def escape source · line 60 · raw

@s:String -> String

a string escaped for HTML text or a quoted attribute value