X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=functions.js;h=2b0370d395c3f0926df88d8197517759835ed0f4;hb=261b88b39c94a5c306dc909c3689fd0e047617ce;hp=ecb41db2ee135e57f8f7b5d9ca5b2580e5825c3a;hpb=6a2034f9ffb51c96ceb8e5bfacb7497ffe6f0820;p=tt-rss.git diff --git a/functions.js b/functions.js index ecb41db2..2b0370d3 100644 --- a/functions.js +++ b/functions.js @@ -2109,3 +2109,13 @@ function transport_error_check(transport) { return true; } +function strip_tags(s) { + return s.replace(/<\/?[^>]+(>|$)/g, ""); +} + +function truncate_string(s, length) { + if (!length) length = 30; + var tmp = s.substring(0, length); + if (s.length > length) tmp += "…"; + return tmp; +}