|
|
|
class: HTML
${linkInternal(href, text )}
input | ${linkInternal(http://www.adjective.com, POS)} |
yields | POS
|
${linkExternal(href, text )}
input | ${linkExternal(http://www.adjective.com, POS)} |
yields | POS
|
${encode(string )}
input | ${encode(hello world)} |
yields | hello+world
|
input | ${encode("want more")} |
yields | %22want+more%22
|
${stripHTML(string )}
input | ${stripHTML(<b>hello world</b>)} |
yields | <b>hello world</b>
|
input | ${stripHTML(<a href="buh">hello world</a>)} |
yields | <a href="buh">hello world</a>
|
${filterHTML(string )}
input | ${filterHTML(<b>hello world</b>)} |
yields | <b>hello world</b>
|
input | ${filterHTML(<a href="buh">hello world</a>)} |
yields | <a href="buh">hello world</a>
|
${smartURL(string )}
${truncEmail(string )}
input | ${truncEmail(bob@bob.int)} |
yields | bob@...
|
${javascriptDocWrite(string )}
input | ${javascriptDocWrite(hello world)} |
yields | document.write("hello world");
|
${unfilter_unsafe(string )}
input | ${unfilter_unsafe(<b>hello world</b>)} |
yields | <b>hello world</b>
|
input | ${unfilter_unsafe(<a href="buh">hello world</a>)} |
yields | <a href="buh">hello world</a>
|
${safetrunc(maxlen | string )}
A simple html text truncation
function. treats multiple spaces as a single
space, does not consider html tags as part of
the text length, and recognizes <A HREF>, <B>,
<I>, and <FONT> tags as tags that need to be closed.
Don't use this on tables or anything complex.
input | ${safetrunc(10 | hello google!)} |
yields | hello...
|
input | ${safetrunc(5 | hello google!)} |
yields | ...
|
|
|